- Home /
StateMachineBehaviour.OnDestroy is getting called by SetActive
I have a subclass of StateMachineBehaviour plugged into a state of an animation controller. When the gameobject that contains that animator is disabled, it appears that the Statemachine behaviour is destroyed, as the OnDestroy method fires, and the behavior is gone.
This sure seems like a bug... am I missing something? How do I get the StateMachineBehaviour to not be destroyed when I disable the object?
I'm getting the same call by Setting gameObject as disabled. Looks like a bug to me.
Your answer
Follow this Question
Related Questions
State Machine Behaviour together with Animation Events 1 Answer
how to make multiple transition from one state? 1 Answer
How to delete a StateMachineBehaviour via Editor Script? 1 Answer
Checking current Animator Controller states gives unexpected result 0 Answers
"Anim A -> Anim B, Anim C -> Anim B" or "Any State -> Anim B" would there be a difference? 0 Answers