Download

Smoother jump animations

I’ve been having a little dilemma. My animation transitions are pretty crude so far, however jumping is the worst. When going from running to jumping, the running animation snaps to the jumping animation. This is most noticeable with legs.

One idea I had was to have a jump animation for every frame of the running animation, but I feel that 24 different animations just for one specific instance is a little overkill. I also tried waiting for the frame of the running that matches the initial frame of the jump, however gameplay is affected if my jump doesn’t execute until a certain frame.

This is just one problem of many. What are the best practices for smooth jumping animations? Thanks!

I have to ask; is this in the character/pawn blueprint or the animation blueprint?

I’m using an animation blueprint inherited from a modified UAnimInstance.

As simple as the action seems it’s actually complex depending on the context of the jump and if you are using in-place or root motion.

The problem is when using in-place the animation is reactive to the movement component and the MC is referenced to world space and not to ground so it does not know if the jump is as for distance or jumping off a cliff and does not supply a value as being close to ground rather then when it’s no longer “in-air” and by that time there is no way to sync the landing as to an event that has already occurred.

Most times the exit statement would be something like. .“if not in_air then exit” so your timing is off as the player for the most part has already landed.

What is needed as a statement is “if player = 2 feet off the ground then exit” which will allow the player to exit into the landing “before” the player is no longer “in-air” adding another state to the more traditional progression

Press Space bar

Launch Jump
Cycle while in air
Exit state before landing
Exit into the run out from the landing.

So whats need is value of just how high the movement component is relative to the ground so that a given action knows when to be triggered with in the constant velocity of the MC.

Best practice would be is the MC should supply this value but until then you could add a line trace to evaluate the distance from ground and use that value to determine when the current state needs to exit “before” the fixed state has changed.that will give you the time necessary for a proper blend.
.

Thanks for the detailed explanation! I have my own movement component inherited from UCharacterMovementComponent and I already wrote all the functions that relate to if the player is within proximity to the ground, if the player fell off a ledge or whose path is about to fall off a ledge, etc. I have all the backend logic figured out, but my real problem is with the animations themselves. I can switch from a looping “in air” animation right to a landing or running animation, however the animations just snap from one to the other without any blending.

My movement is very precise with a style similar to Mario, Ratchet and Clank, and other 3D platformers where precise player input is more important than realistic physical animation. Another game I’ve been looking at is A Hat in Time since it’s built in UE3, however the source belongs to GFB so I can only look at the character while I play the game.

So are you trying to code the function instead of using a blueprint then? If so you might get a better response in the C++section as in “Animation” most problems is forward related to making animations work with in the Animgraph.

The requirement to get something to blend usually follows State A > Blend Function > State B. For example if you look at the “Blend By Int” nod it has a blend by weight value. With out this function animations will just jump from one state to the other with zero interpolation causing the animation to pop (aka snapping).

Both blueprint and code are valid answers as I can just convert between the two.

Blend By Int? I have absolutely no idea how I glanced over that one, I even looked through the source for the keyword “blend”. Sounds like I can actually whip something up with this, though. Thanks! :cool:

Can you post your animgraph and the settings your are using on the blend transition in question?

No need, some idiot forgot that a Blend function existed (I’m also not at home).
It all just depends on how your Google searches are worded…

Thanks for the good ideas to bring it. I know a lot more. ::stuck_out_tongue:
สมัคร ufabet](http://www.ufa007.com/ufabet)
Ufabet