How do I get rid of the lag between the "any state" and the jumping in 2D animation? *details inside if you don't understand question*

For those that don’t understand said question here it is in detail, with some background notes.

So I am a beginner when it comes to unity and i am average at coding. So I am going through the character controller building my character and I think to myself, instead of having a 1 frame animation on the way up, how about I do a multiple frame animation on the way up. You know like a character bringing there arms upon the way up or doing something with their legs.

So I was messing with that and well, it didn’t turn out so well. The animation pauses on the wrong frame and starts way to late. My character is in the air doing its idle animation and then does its jump animation almost half way through the jump.

So I thought, well maybe I can alter some values like the time when vSpeed hits and the animation in the tree plays. (sense I did it the he did it in the video except with 7 frames because that’s all my sprite has)

Needless to say that didn’t work. I decided I would get rid of the frames that happen after the first 3. (first 3 frames are for on the way up and the other frames are for the way down) This just leaves the problem of the animation starting so late.

I would create a video because that would be more helpful than me typing but there’s no point if someone can understand through all this jibber jabber I just typed.

So how do I get rid of the lag between the “any state” and the jump?

It is a bit late but, i have encountered the same or similar problem with you.
For those who has the problem and did not realised the cause i will say something that might be the solution.
By the way i am using Unity 5.0, and it seems a little different then the previous versions.
The thing what i have done is on the animator screen when you focused on the transition, there is “settings” collapsable part in inspector. When i expended it, i saw “Exit time”.
When you disable it (The check box just above), the next animation will be animated immediately.
It was settep up enabled by default when i used the survival shooter tutorials assests.

Not sure if you’ve figured this out already yet, but I’ve been having the exacty same problem for months. Just figured it out.

In your Animator, check and see if your Jump animation is transitioning from “Any State.” If it is, delete that transition and instead connect your other animations directly. The lag goes away as soon as this is done. Take a look at my screenshot to get a better idea of what I’m saying.

That help? Hope so! [32811-screen+shot+2014-09-22+at+11.37.08+pm.png|32811]

You may be better served by checking out a tutorial on animating with Mecanim (Here Perhaps?) but I’ll see if I can’t be of any help-

In the animation controller window, you can click on the lines between states and set the conditions that the animation transition will happen under. by default there is a parameter called exit time that waits until the current animation is almost done before transitioning. if you remove that, the transition between states should happen instantly.

To check whats going on, you could take the animator window and drag it to some other panel so that you can watch what transitions are occurring when, and how long they take to happen at the same time you test.

Hope I helped! Best wishes! :slight_smile:

thanks to Cureshot