Download

Smooth Direction Transitions

Hi guys!

I created a thread about smooth animation transitions here: https://forums.unrealengine.com/showthread.php?8485-Question-Example-Smooth-Animation-Transitions

It’s more of a blueprint thread so I should’ve pasted it in this forum section, but oh well. I was able to find a solution (that didn’t use timelines) to smoothly transition animations based on button press, like holding shift to sprint will gradually build up momentum.

Now that I’ve done that, I’ve quickly realized that our character’s movement would benefit from lerping the rotational changes in direction as well. Right now when the player holds the ‘W’ key down, the character runs in the “0 degree” direction. If the player were to then hold ‘W+D’ for diagonal movement, the direction would instantly snap to “45 degrees”. If he were to then hold just ‘D’, it would snap to 90 degrees and he would play the strafe animation. That snapping forces animations to hard-switch and hard-blend, which defeats the purpose of the blend space!

So now I’m trying to figure out a way to interpolate directional changes rather than just instantly update inputs as they come in. Here’s our character direction and speed setup:

Any ideas as to how you’d lerp the rotation as it changes rather than just instantly changing it? Messing with rotators is a weak spot for me so I was leaning towards manipulating the MoveDirection float, but I’m not sure in this case how MoveDirection is actually being calculated (I see the rotator blueprints but it doesn’t mean I understand them :))

Thanks!