- Home /
Animator's animation doesn't stop immediately.
Hey guys, I've always worked on puzzle games before so I have no experience with the animator in Unity. So I followed Mike's "2D Character Controllers" tutorial to animate a 2D character. It was all working well until I stopped running my character. When I stop walking the running animation does not stop right after that. It waits for its completion to go back to idle state.. which by the way has no animation and I don't know if that's the reason it doesn't stop immediately because Mike's character had an animation for idle state. Thanks a bunch.
Nope, it's a running animation therefore it must have loop.
Answer by DiegoSLTS · Jun 22, 2015 at 07:21 PM
Show us the conditions you use for the transition from Walking to Idle. You might be using a parameter (a bool maybe?) and the Exit Time or a transition duration. Unity waits until the exit time passes before checking the other conditions, and waits the "transition duration" before changing the animation (at least in 2D animations, in 3D it does a blend between both).
Read this: http://docs.unity3d.com/Manual/class-Transition.html
And look at this tutorial for an example: https://unity3d.com/learn/tutorials/projects/2d-roguelike/player-animator
Thanks for the answer, I have a speed variable which is a type of float. When it's greater than 0.01, I start running, when it's less than 0.01, I stop running. I have unchecked "Fixed Duration" and set "Transition Duration" to 0. Although it has helped me a little, I still have a bit of lag. Any ideas?
Your answer
Follow this Question
Related Questions
How to handle multiple animation variants 1 Answer
Animator parameter does not pick the value of the animation curve with the same name 2 Answers
Wrap Mode in animator not working properly 0 Answers
Display additional animation on top of other animations 0 Answers
Animator Override Controller changed at runtime doesn't always play the animations correctly 1 Answer