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.