So pretty much I want my character to change animation based on the way he is turning, I’m using a joystick and was wondering hows the best way to detect when he is moving left or right or just moving forward. I was originally getting the angle of the character and comparing to the angle he was in the previous tick but it turns out to be pretty stutterery and weird. This is what I got atm.
As you can see its pretty bad. I also need to stop the arms flailing after he exits the state.
At each frame you determine how the objects direction gets changed (by evaluating the users input). Would it make sense to use this input (or its outcome) to calculate the leaning too?