Radians "resetting" when lerping the rotation of a node

Godot Version

4.3

Question

I am trying to make the enemy look at the player lerping the rotation of the enemy, but when it reaches a certain point it does a whole spin because the radiants “resets”, i dont really know how to explain, look at the video and maybe you’ll understand.

are you using lerp_angle?

1 Like

Sometimes angles lerp weirdly if you’re using euler angles. Can you try to re-do this with quaternions? If you look closely it seems like the weird behaviour happens when the enemy has spin near the -x axis. It doesn’t want to cross the -x axis so it goes all the way around the other way.

Sorry please ignore the part about quaternions, forgot those aren’t a thing in 2D. But the problem still arises from the negative x axis so that’s related somehow

i was using lerp not lerp_angle! Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.