Problems with rotation, look_at( ) and "faces" in 2D

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

Let me start by saying HI! Its my first post in Godot q&a.
My question involves rotation in 2D. All i want to achieve is to rotate a sprite towards a point in 2D space. See below.

Better res here: https://i.imgur.com/2j17kcZ.png
Example using arrow like sprite : https://i.imgur.com/rjuDC18.png
As you can see it seems that Godot picks wrong “face” of the sprite. I tried both look_at method as well as setting rotation degrees. I also’ve tried doing something in _process( ) but the results where the same. I haven’t touched any properties of the objects beside scale of one of them. Using $Sprite.rotation_degrees += 90 seems to do the trick. Any ideas on why the sprite behaves like this?
Thanks in advance.

i guess it’s just matter of how texture look.
how about the texture is made towards to right direction?

volzhs | 2019-05-01 16:35

Yes, that “works”. But it’s the same type of solution as adding 90 deg in script. I would like to keep my textures as they are.

arcadeoid | 2019-05-01 16:41

I just wanted to say that its behavior seems fine or bad depending on how texture looks.
hm, another trick would be having a parent node like Node2D or Position2D

- Node2D (actually controlled by script)
    - Sprite (rotated 90 deg)

then you don’t have to do +90 deg every time.

volzhs | 2019-05-01 16:52

So its just engine design issue? It doesn’t seem intuitive.

arcadeoid | 2019-05-01 16:59

You are completely right. It seems like Godot rotation works like this: Radian – Wikipedia, wolna encyklopedia
I thought 0 deg should be on “top”.

arcadeoid | 2019-05-01 17:13