0 votes

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.

asked May 1, 2019 in Engine by arcadeoid (16 points)

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

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.

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.

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

You are completely right. It seems like Godot rotation works like this: https://pl.wikipedia.org/wiki/Radian#/media/File:Degree-Radian_Conversion.svg
I thought 0 deg should be on "top".

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.