Node2D#look_at permanently skewed by 90 degrees

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Max Aller
:warning: Old Version Published before Godot 3 was released.

I created an image that has an origin in the middle of the left edge and “points” out to the right. I want it to point towards the mouse cursor, which seems to be working…except that it’s consistently 90 degrees off. That is, when the cursor is due right of the origin, the image is pointed straight up.

Other than recreating the original image such that it’s pointing straight down (which seems odd to me anyway), what are my options for fixing this?

Thanks!

:bust_in_silhouette: Reply From: eons

Should not be odd that a image is made with the wrong rotation, that can happen.

To solve it without touching the original image, manually rotate +/-90 the sprite node if the one that “looks at” is the parent, so it will be always 90 relative to the parent.

Ah, perfect, that worked like a charm! To rephrase, I created a new Node2D, attached my “follow-the-mouse” script to that, and added the original image as a child of that node but rotated 90 degrees.

Max Aller | 2017-10-19 01:04