Search Unity

Animator States play without transitions

Discussion in 'Animation' started by Rosie-Posie, Jun 2, 2015.

  1. Rosie-Posie

    Rosie-Posie

    Joined:
    Nov 20, 2013
    Posts:
    54
    Hey guys, I've been fiddling with mecanim and anim controllers for a while now, but I'm finally diving in deep and trying to make a complete character State Machine form A-Z. But unfortunately I'm running into some weird "invisible" walls. I'm using unty 5.0.0F3 and my character is Generic.

    I think a GIF is worth a thousand words:



    As you can see, even though there are no transition to my CrawlFast state, it always manages to go to it! I tried closing unity and open my project up again, to no avail.

    I don't have any kind of code or scrip on my character or animation controller that could justify the animation change.

    I also noticed that no mater what i did, it seam to disregard Bools. I'm still a little fuzzy on the use of Entry and Exit, so don't hesitate to give me a lesson if you see something totally wrong with how i'm hooking this up.
     
  2. Mr Gibbon

    Mr Gibbon

    Joined:
    Mar 27, 2012
    Posts:
    4
    I'm also getting a problem like this, it's in Unity 5.0.1p4, on a humanoid rig. I get it on hitting the Exit node of one particular sub statemachine, it jumps to the wrong state.

    In my case it was jumping to a state with no transitions in or out (one that is intended only to be used with Animator.Play) even if I remove all references to it in the code. If I delete and re-create the offending state, it now starts to jump to a different (but still wrong) state - this time it's one that has transitions in and out. I think the fact that we both had it jumping to a 'floating' state was a coincidence.

    The other significant thing about my case is that it's happening on an animator controller that was copy/pasted (duplicated with ctrl-d in the project view), so I don't know if this could be related.
     
  3. pierrepaul

    pierrepaul

    Unity Technologies

    Joined:
    Jun 19, 2012
    Posts:
    162
    Hi.

    It seems that you are exiting from a StateMachine that does not have an outgoing transition. In that case, behaviour is undefined.

    Is that possible ? If not, please send us a bug with repro controller.

    ( we want to improve in the future so that it does fallback to default entry transition)

    cheers.
     
  4. Mr Gibbon

    Mr Gibbon

    Joined:
    Mar 27, 2012
    Posts:
    4
    Thanks, that helped track it down. The problem appeared to be due to having ambiguous transitions, i.e. two transitions that test different conditions, both of which were true in this case. Fixing that appears to have fixed the problem.
     
unityunity