Multiple enemies and no animations
Hi! oh wise community I need your help.
I have a problem with my enemies. I have one single enemy object and the idea is to have multiple enemies in the game. When I add to the world just one enemy it works perfectly fine, both script and animation wise. The problem comes when i have 2+ enemies, they all work fine script wise, but only one runs the animations, the rest is stuck in the Idle stance. I don't think/want to do x number of AnimatorControllers to solve this, that would be nuts.
thanks in advance for any help :D
PS: if it helps you to know this, I already tried having both enemies just as gameobjects, one gameobject and one prefab, both prefabs, and nothing works
Of course you keep using copies of the same enemy prefab, that's out of the question :)
What is triggering the state change of the enemy that it works with? script on the enemy? script somewhere else?
If one enemy can change its animator to another state, it must have a boolean changed and some script does that and apparently it does that only once ins$$anonymous$$d of twice, so there must be a difference in the trigger condition.
the state change script is on the enemy, not on another gameobject. The script does changes the boolean and it changes only once(that explains the single enemy that works). How could a single AnimatorController be shared by, say 25 enemies, and all in tip top shape? or ir that the wrong way to tackle this problem?
that's exactly how it should already work. is anything static in your script? it does not make sense to me that each guy has it's own script and sets it's own bool but on only one it works, doesn't make sense. have you tried setting a debug log at that line to make sure it's called as many times as there are enemies?
Your answer
Follow this Question
Related Questions
Animations get screwed up when I add OnAnimatorMove function 0 Answers
MobController 1 Answer
Animator controller probably messed up, need advice 0 Answers
animation.Play() won't work 1 Answer
Switching lanes 1 Answer