Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Animation won't play unless Has Exit State is checked

Discussion in 'Animation' started by VoodooDetective, Nov 8, 2019.

  1. VoodooDetective

    VoodooDetective

    Joined:
    Oct 11, 2019
    Posts:
    26
    I've got a really simple animator controller. There are two states. "Talking" and "Not Talking." Think character portrait.


    I can't seem to use "Any State" properly. Here's what the graph looks like.

    Exit
    Entry -> "Not Talking"
    Any State -(if state == 1)> "Talking"
    Any State -(if state == 0> "Not Talking"

    With this setup, if I set the state = 1; the animation will not play UNLESS I set the transition to say "Has Exit State."

    If I stop using Any State, everything works as expected. The issue is, I'd like to be able to use Any State since I plan to have many more states and I don't have a crazy n-to-n graph.
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    595
    That's pretty strange and sounds like a bug, though Animator Controllers are pretty convoluted so there could be something else causing the issue.

    If you don't actually need to customise the duration of each transition, you could simply remove them all and call CrossFade("State Name", transitionDuration) without using a parameter at all.

    You might also be interested in Animancer (link in my signature) which lets you avoid the need for Animator Controllers entirely. You can just get an AnimationClip and play it without messing around with states/parameters/transitions.
     
  3. VoodooDetective

    VoodooDetective

    Joined:
    Oct 11, 2019
    Posts:
    26
    Ah ok, that works for me. Maybe it's a bug :(. Thanks for the cross fade tip!