Hi I want to instantiate all eniemes in array of game objects, but they are instantiated twice. Why does it happen? Code (CSharp): if (!spawned) { foreach (GameObject enemy in enemiesToKill) { Instantiate(enemy, enemy.transform.position, enemy.transform.rotation); spawned = true; } }
@Evoroso do you run your script in Update, or at initialization? You maybe simply have two scripts attached to GameObjects. In your Project tab in Unity, right click on the script and click Find References in Scene