Hi,
- I have multiple instances of an enemy prefab in my game.
- I have a different object that needs to trigger a method within these instances that checks whether the enemy is moving. If it is, the method will reduce it’s speed. If they’re not, the method will do nothing.
Question: Because the enemies are moving at different speeds, I cannot make the speed static within the enemy prefab script, and thus I also cannot make the method static. What is the correct way to use one script, to trigger a non-static method on multiple instances of a prefab?
I’m new to coding/Unity, so I hope that question makes sense. I can’t seem to find documentation on this anywhere so I may either be asking the question wrong, or missing something very obvious.
Thank you,
Joe