- Home /
How do I make the transition between two states in the "Animator" happen instantly?
Hello everyone. I am trying to make a transition from one state to another in the "Animator" state machine happen instantly. By default, the animator seems to finish the current animation first before switching to a new state. Since I am using looping animations, this causes new animations to start with a delay of a few seconds, depending on the lenght of the previous animation, which is inappropriate for some animations, like idling->walking->idling, as it causes the character to keep walking even when it's not moving anymore, or move before the walking animation actually starts. I've tried to find a solution but I couldn't find an option or script function that would do this. Does anyone know what I would need to do so the transitions work instantly? Thanks in advance!
Also, although I guess it's unlikely that it's possible, is there a way to insert "points" into an animation where it can stop and start the transition to the next state? Like walking->idling when either foot is touching the ground?
I'm having the same problem, did you ever find a solution? I have an idle animation that takes 2 seconds to loop, so after I start moving it takes up to 2 seconds to start the walking animation.
@Brad1011 Try $$anonymous$$aking a transition from Any State > IsWalking Animation. $$anonymous$$ake the condition something like if isWalking = true. Set isWalking to true and it should immediately start the Walking animation. You might have to set transitions to non atomic.
Answer by Hassan-Kanso · Oct 11, 2015 at 03:09 PM
Select the character you want to edit, and open Animator window.
Select the Transition you want to remove its delay.
UNCHECK "Has Exit Time" checkbox.
do it for every transition you want to change and it should work :)
I think it must be unchecked by default but yeah nothing is perfect
AlSO give "Transition Duration" a value of 0. Else you still will see a little bit of delay.
Answer by tanoshimi · Nov 07, 2013 at 11:14 PM
In the transition inspector, uncheck atomic, and drag the blending time between the two states to zero.
Answer by Brad1011 · Nov 08, 2013 at 12:29 AM
I ended up finding the answer to my own question here: http://answers.unity3d.com/questions/571005/animator-transition-in-middle-of-animation.html
Your answer
Follow this Question
Related Questions
How to generate Mecanim Sub-state namehash? 6 Answers
Not able to use a Vector as a condition in Mecanim? 2 Answers
How to get fileID information so i can just edit Mecanim Animator through script? 2 Answers
Easier way of creating transitions in the animator? 1 Answer
Animator.Play not working when in Sub-State Machine 1 Answer