Instantiating enemy simpler way to enemySpawner

There is another override version of the Instantiate method that accepts parent transform:
Instantiate(enemyPrefab, new Vector3(0, 0, 0), Quaternion.identity, transform);
This will instantiate enemy right under the wanted gameobject transform.

I just wanted to note here that I tried your way and I found it out Instantiate only began to accept 4 arguments starting with Unity version 5.4. I was banging my head against this issue and thought I’d save others the headache.

Good tip, thanks!

Privacy & Terms