- Home /
Help with animation.
Hello all new here. Well I have a 2D running game & I have it to double jump with the animation playing but once the animation is done it goes back to running before it even hits the ground so I made a landing animation & not really sure how to apply it cause when I make a transition now my player is stuck at an animation. I would only want the character to run when it’s on the ground. Can anyone help?
Answer by Stratosome · Jul 17, 2018 at 10:55 PM
Hi there!
For jumping, I'd suggest using a Blend Tree for the animation. Given some value (perhaps like the characters velocity in the Y direction) you can pick a certain frame from the jump animation so that it looks like a natural jump and the animation plays for the whole jump motion (this would also work nicely for a double jump). You can also have some kind of ground check that sets a boolean in the Animator window (isGrounded) to true or false. That way, you can play certain animations if the character is on the ground or not. This tutorial could help with the ground check if you don't already have something for that figured out.
Hopefully those point you in the right direction!
Your answer
Follow this Question
Related Questions
2D Animation does not start 1 Answer
Animation disturbing circular rotation 1 Answer
Setting animator parameter on a single instance of a prefab sets the parameter for all instances 3 Answers
Sprites: Project Sprite to Mesh, allow for bending of sprites for 3d environments 0 Answers
Spine animation: how to use a skeleton from a project to transfer to a new project in Spine? 1 Answer