Search Unity

Interrupting a transition to one state with a transition out of the same state

Discussion in 'Animation' started by SomeCode, Nov 18, 2013.

  1. SomeCode

    SomeCode

    Joined:
    Jul 5, 2013
    Posts:
    32
    I've set up a very simple project with a character that has two Animator states: "idle" and "walk". Both of these states transition to and from each other based on an "isWalking" boolean condition.

    Overall, it behaves as you'd expect -- the character plays his walk animation when he starts walking, and plays his idle animation when he isn't walking. However, if I rapidly tap on the joystick, causing the character to quickly move-stop-move-stop, it seems that his transitions are never interrupted. In other words, what I would expect/desire is that when the character is idle, and I quickly tap him in a direction once, he would very briefly start to transition into the walking animation, but immediately stop that transition and instead transition back to idle, so to the human eye, the character would essentially appear to just 'restart' the idle animation. However, what I'm getting now is that when I tap in a direction quickly, the character will play through the entirety of the transition to the walk state, and then go back to the idle state, so the character will stop translating (which is driven by the script), but will awkwardly finish going to the walk state before settling back into the idle state.

    The documentation makes it sound as if setting the "Atomic" property to off is what would fix this, but it doesn't seem to be making any sort of difference. Any solution, in or out of script, would be greatly appreciated. Thanks!