Hello again.
I am a bit confused by Node3d's rotation methods. Here is what I am trying to do:
- Get node3d position as origin position Vector2
- Get target node3d position
- Calculate angle difference between origin and target position with arctan((targetY –originY) / (targetX – originX))
- rotate y axis of unit with node3d. set_rotation(origin rotation.y + 0.01) every frame if angle difference is greater than 0.1
But when I run the code, the turning seems to be mirrored and turn to oppsite direction of desired direction(turn left/turn right swapped), and sometimes it just rotate to wrong facing.
So is there any glitches withun my steps/formula used that caused this syndrome, or I used set_rotation wrongly?
Thanks.