Domanda

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?

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top