Leaning when turning Third Person

I want to make my third person character lean inwards when turning. My camera does not move with the character.

So far I have tried to replicate this but I can’t get it to work without problems. [link text][1]

So I have a line trace looking for the floor and when I turn I’ve stored the axis with a delay and then compared it to the current axis to see which way the character should lean. I get the angle from Atan2 (Degrees) which gives me 0 to 180 on the positive right axis and 0 to - 180 on the left. Which I turn to a positive number to simplify the calculations.

My brain is dying trying to figure these things out. But I’m sure they are simpler than I make them.

Hey there!

You could store the yaw rotation of the character from the previous and current time step. And if yaw increases, use the “Set Local Rotation” node and add to the “roll” input. This way, when the character is turning, they will appear to “roll” w/ the turn.

Are you still looking for an answer? Let me know and I can provide more info!

Hello! Since this was ages ago I have since figured this out. Also, Unreal released this in their Paragon assets not too long ago if anyone else is looking.

May I ask for more details on how you solved this?