Playing animation in pieces depending on speed

I am currently making a top down game, and have introduced turning in place with an aim offset, using a layered blend per bone to handle the legs, for rotation and the upper torso for “aiming” but I want to play the leg animation at a certain speed, depending on how fast the player is moving the mouse, similar to the game “ruiner” where stopping the mouse half way through the turn animation almost “freezes” the animation in place, what would be the best way to do this? I’m kinda new to game dev as it is

Hi there @Sigma_Giga_Chad1 and happy holidays! :christmas_tree:

This topic has been moved from International to Character & Animation.

When posting, please review the categories to ensure your topic is posted in the most relevant space. Hopefully, this category change will help to get you an answer.

In the meantime, good luck and happy developing! :slight_smile:

Hi Sigma_Giga_Chad1

A “BlendSpace” would work well for that - have one axis the speed, starting at idle and ending with the fullspeed rotation.

so should I use the blend space instead of the actual animation?

You would build the blendspace from your animation, The BlendSpace1D would be the way (it’s in the legacy section)

Set your skeleton the animation uses when it asks, then you can drop your “idle” animation in at the “0.0” value, and your rotating animation at the “100.0” value. You can change that “100” to whatever your maximum speed will be.
You can then replace your animation in your AnimGraph to the BlendSpace - you’ll need to plug in the “Speed” as well.

If you haven’t already got a speed value, you can get that by calling “GetVelocity” on your character (GetPlayerPawn->GetVelocity) and then a “Vector Length” plugged into that.

i think I got it, I tied the 1d blend space to yaw, and then used two 180 degree turning animations to blend between them as the player rotates their character

1 Like