- Home /
How can you cancel the current animation?
Hey guys,
I'm new to Unity and I just started to program a 2D Game. I used the animator to change between the walk and idle animations. My problem: If I start to walk while the idle animation is still in progress, the walking animation just starts right after the idle animation ends.
I want to change the animation immediately if the condition is given
Comment
You can either use Animator.Play to instantly start playing a state, or set the transition between your states to have no exit time:
Answer by Skwall · Nov 23, 2016 at 01:51 PM
You should uncheck the "Has Exit Time" checkbox in your transition.