Lerping Rotators- object spins backwards if the rotation would take it to 360 or higher on a given axis

Hi there. I have an object which the player can rotate in increments of 90 degrees. In terms of the animation for that, the way I am achieving this is with a lerp (rotator). The starting position is of course a rotator variable which describes the last position, and the destination is calculated by combining that rotator with a second 0,90,0 rotator. This works fine for the first three rotations, however when the fourth rotation occurs and the object should rotate round to 360, it instead spins backwards 270 degrees. It ends up in the correct position of course, but goes back the wrong way. How might I phrase that calculation so that it rotates in the same direction?

… I am such an idiot, thank you so much!

Do you have shortest path ticked?

1 Like

We’ve all been there and done that. Good luck with the rest!