if i destroy 1 object from array they movement change code example
Example: if i destroy 1 object from array they movement change
void Update(){ foreach (GameObject enemy in Enemies){ if (enemy){ // ignore dead enemies Dist = Mathf.Abs(transform.position.z - enemy.transform.position.z); if (enemy.collider.tag == "Enemy" && Dist < FadeDistance) { //fade out (level of alpha 0 = transparent, time to take to fade) iTween.FadeTo(enemy, 0.0f, 0.2f); Destroy(enemy, 1); // you don't need a coroutine for this! } } }}