Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Why would method StateMachineBehaviour.OnEnable() be called when I disabled Animator component?

Discussion in 'Animation' started by SolarianZ, Oct 28, 2020.

  1. SolarianZ

    SolarianZ

    Joined:
    Jun 13, 2017
    Posts:
    245
    Why would method StateMachineBehaviour.OnEnable() be called when I disabled Animator component?

    upload_2020-10-28_9-39-31.png
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,584
    It's probably entering the default state since the Animator Controller system was evidently designed by people who think it should reset everything when disabled unlike literally every other part of the engine.

    Can you log the name of the state it's entering?