Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

"Animator is not playing an AnimatorController" when fetching layers or params from Property Drawer

Discussion in 'Editor & General Support' started by Senshi, Dec 3, 2017.

  1. Senshi

    Senshi

    Joined:
    Oct 3, 2010
    Posts:
    534
    So I just noticed a really annoying issue that one of my assets has in Unity 2017.1+.

    In one of my custom property drawers I am requesting a list of the an Animator's parameters using animator.parameters. It works fine, until I make a change on the component and save the scene, at which point the warning throws and the parameters become unavailable. Deselecting the object and reselecting it fixes the issue.

    Is there anything I can do to prevent this behaviour? I've already tried checking for a null animator or animator.runtimeAnimatorController, as well as animator.isInitialized
    and animator.isActiveAndEnabled, and all come up positive.

    I did find some similar issues, but no clear path to a resolution.

    Thanks in advance!
     
  2. Senshi

    Senshi

    Joined:
    Oct 3, 2010
    Posts:
    534
    Just got back to this project and the issue still persists in 2017.2.0f3. Any thought?
     
  3. OopTick

    OopTick

    Joined:
    Jul 2, 2015
    Posts:
    1
    if (!animator.isInitialized) {
    animator.Rebind();
    }

    this worked for me
     
    ExcaliburGames likes this.
  4. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,071
    I get this when I turn off my main character in the game, even if he is off and all sub objects are off this message still comes up, very weird. How do I stop it ? I mean a code tweak wont work surely because no code is even running since theyre all off.
     
unityunity