- Home /
[StateMachineBehaviours] All prefabs share same state machine.
I'm experimenting with AI state machines using mecanim. It was going well until I realized all the AIs are sharing the same instance of their state machine.
I am not doing anything strange. I basically have a bunch of prefabs, that have Animator
components, these have my desired AnimatorController
.
I tried Instantiating the controller on Awake
, just to be sure: _animator.runtimeAnimatorController = Instantiate(_animator.runtimeAnimatorController);
That didn't fix the issue. I also tried setting the Animator
from another sane script into the SMB (my SMB scripts have a data section that is set on Start
). Using that instead of the passed-in animator
didn't help either.
Any ideas what the problem is? I find it hard to believe this is expected behaviour... Thank you!
Your answer
Follow this Question
Related Questions
State Machine Behaviour public variable not assignable from editor? 2 Answers
How to delete a StateMachineBehaviour via Editor Script? 1 Answer
Animation Event and Sate Machine Behaviour 0 Answers
The Quantum Animator? - Animator behaving differently when animation controller is open in editor 0 Answers
Easier way of creating transitions in the animator? 1 Answer