I have a list of GameObjects. They all have a script in common. Is there a way to load the script only once and control all the GameObjects in the list?
Hello there! I was making a simple test with dynamic lists as shown here: link In summary: - I have two scripts. A "GameController" and a "EnemyScript". The "EnemyScript" is attached to each Cube, and contains a method called "explode", which I call on the GameController when I press Space. The thing is, I'm adding each Cube dynamically so I'm putting them in a list, however, I haven't been able, for the life of me, to make all the Cubes explode unless I also load EACH EnemyScript in a separate list. (as you can see in the GIF) So my question is, is there a way to load the "EnemyScript" only once and have that be added to all of my Cubes in the list? Because I don't really know if what I'm doing is very efficient, or it's the way it's supposed to be done. I'm not following a tutorial and just kind of trying to make things on my own. Thanks for the help guys!