How to adjust orientation of texture in sprite

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

I have a sprite which controls the movement of a clock hand by using the mouse, basically at the end of the hand. I am using look_at(MousePos) for this and it all works perfectly except that the sprite, which is vertical at the 3 o’clock position is 90 degrees off at 12 & 6 o’clock & so on so I guess I need to rotate the texture but nothing else to keep it vertical whilst it moves around the centre point. Is this possible?

Don’t know if it’s relevant or not but the sprite is set as a child of the hand and the position of the sprite is set at the centre point of the circle with an x offset to its position.

:bust_in_silhouette: Reply From: neolith

I am not sure I fully understand your setup here, but I guess the easiest way to rotate a texture would be to use the sprite as a child of another node and rotate it there independently.

If you don’t want to do that, a shader might be another solution. This or this might be a good starting point.