Answer the question
In order to leave comments, you need to log in
How to edit an array?
I have opponents that spawn on the level all the time. And each enemy after spawn tells the script a link to it.
I don't want to render every frame like this:
GameObject[] array = GameObject.FindGameObjectsWithTag("Enemy");
Answer the question
In order to leave comments, you need to log in
Get a List in the class where you spawn (spawn manager). Do list.Add(newEnemy). the code needs to be removed call list.Remove(deadEnemy)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question