1
votes

I'm using Animator to more easily control the state of a player sprite. Player sprite has only one frame for different animations (single image per different state), however - animator shows that it plays each frame 17ms.

So when player jumps I set animator parameter "InAir" to true, it should change sprite image instantly to InAir state, but for single frame previous state is visible (I believe it's because it takes 17ms for animator to transition) and in game there is noticeable flicker after jump.

How should I implement instant transition or is it possible to change the animation play time?

1
I implement a similar system in this video youtu.be/uiVjzjQwJD4 you can just pause at certain points and see how I did it... Copy everything I did exactly and it will work as mine does :)Savlon
Hello,thank You for the response. Unfortunately this setup does not help, there is the same problem in your setup as in my setup - 1-3 frames will be drawn before _animator.SetBool will take effect...Gabriel Davidian
Ah I see... This could potentially be a unity bug... Have you sent a bug report?Savlon
I'm thinking about it, I was hoping that I'm doing something wrong. Anyway, thanks for video.Gabriel Davidian

1 Answers

1
votes

I had the same issue recently in Unity 5.3. I fixed it by clearing any Exit Time values for the transition. For some reason when the transition was created it was given some Exit Time default values which added extra time to the animation.

It can be seen by clicking on the transition and viewing the Inspector window.

enter image description here

My transition happened instantly when I disabled the Has Exit Time checkbox, and cleared the values under Settings.

enter image description here