Node won't rotate correctly

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MTM828

Hi,
I’m trying to get my node to look at a certain position with look_at(), it works fine when the target is under the node and on the left side, but in any area other than that would make it point to the wrong direction.
It’s not randomly turning, it turns an extra 90 degrees whenever the target moves beyond that position.
Is it a bug or am I just misusing look_at? All I’m doing is look_at(target.global_position).

Is the node facing to the right when it’s at 0 degrees rotation?

exuin | 2022-08-24 15:01

:bust_in_silhouette: Reply From: MTM828

I literally had a piece of code that would make it rotate 90 degrees when the sprite is rotated 115 degrees or more… sorry please don’t kill me.