Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. 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:
    213
    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,467
    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?