Making skeletal mesh tilt towards direction it's moving.

So I recently watched this absolutely fantastic animation talk by David Rosen (Programmer and Animator on overgrowth as well as one of the creators of the Humble Bundle). My friends follow Overgrowth almost religiously so I’ve heard a lot about it and know that he’s done a lot of cool stuff with it but after watching this I really want to try out the same thing. I’ve decided to start from the beginning so I’ve been attempting to get my first person character to lean slightly depending on what direction he’s going. I wouldn’t be asking for help if I wasn’t at my wit’s end with this D: I was thinking of posting this in Content Creation since it’s technically animation but since I’m mainly planning on using the AnimBlueprint to manipulate bones and interpolate between poses I thought it would be better answered here.

At the moment what I’ve got is this Animation Blueprint:
Event Graph:

Anim Graph:

At every tick of the Animation being updated it gets the pawn that’s using it, grabs the velocity and rotation, turns the velocity into the “Speed” float, makes it so the velocity number is local to the mesh rather than the world and then sends that off as “rotate”. Then in the AnimGraph it uses those two to rotate the root bone making the player lean. In theory it works well-ish but in practice it has some problems with it. Moving left and right causes you to lean backwards and forwards and moving forwards and backwards causes you to lean left and right. I’ve attempted to remedy this by - or +90 degrees to the rotation but it causes only one of the directions to work. I’ve also tried using the other node you see in the AnimGraph but I can’t get it to do anything. Any help at all would be greatly appreciated, I really have no idea what to do D:

I saw the same GDC talk; very cool stuff!

That being said, I believe he used interp with a curve for 99% of his animation. Jeff Farris touches a little bit on some of the other interps here: The Subtle Magic of InterpTo() - Announcements and Releases - Unreal Engine Forums , and goes on to say that some of the math isn’t available to BP just yet.

Sorry if that doesn’t get you in the right direction.

I tried using an FInterp To for the speed value and it’s made it a lot smoother so thanks :slight_smile: The main problem I’m having though is leaning the character in the direction that the rotator states, I’ve tried turning it into a string and printing it out to monitor it and see what it’s coming out with but it seems like it’s pointing in the right direction. I think the main problem I’m having is the method for actually rotating it :\

Still going over it all my self but I believe the way to do it is to use an additive offset.

Leaning would be more or less the same as to how aiming is done using a blend space or how and additive pose can be injected for firing a weapon in a given direction.

Movement in general though I would consider as a root state that is absolute so if a player model has to lean into the direction that it’s moving then it should be animated that way.

I got this going in a few hours last night.

Let me know if you have any questions.

You’re correct. He has a single keyframe for most of the animation poses, and just interpolates between them using springs and curves. It’s actually really smart considering they are a two man team ( if I remember correctly )

I was able to get it to work by using SetActorRotation. I used the velocity to determine the pitch, but had to divide it down and then multiply by -1 to get a negative number to pitch forward. I used GetActorRotation so the roll and yaw wouldn’t default to zero. Hope this helps.