B
B
BadCats2017-08-27 19:49:40
C++ / C#
BadCats, 2017-08-27 19:49:40

Correct animation playback?

There is a 2d character with a collider and Rigidbody2d - it also has two animations - rest and walk - and transitions between them in the Animator depending on the speed. And there is also a third animation - the jump animation - which also has a transition - depending on the bool variable IsGrounded. The character jumps on pressing the spacebar - but it lands too fast and IsGrounded becomes false and the animation doesn't have time to play and goes to the "rest" animation. How to make the character jump - that is, was in the air or above the ground until the animation is played and not vice versa?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
twobomb, 2017-08-27
@BadCats

As an option, either speed up the animation or shorten it, or make the jump higher or interrupt the animation forcibly upon landing. It's more likely that the animation is not built correctly if it lasts longer than the jump. When I also did a jump, well, I had an animation of repulsion from the ground at the end of which there was an event that included a looped animation of the character in flight or not an event, but I just don’t remember exactly the transition in time.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question