![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | lowpolygon |
I am currently following this tutorial video
it is a really simple scene, all I have is a node 2D root and a sprite. and this is my code
extends Sprite
var mousepositoion
func _process(delta):
mousepositoion = get_local_mouse_position()
rotation+= mousepositoion.angle() * 0.1
which is the same as the video. But result from mine is different. Lets say if I move my cursor directly above the sprite, it would rotate to the left and if I move my cursor to the right, the it would face up. I am not sure what I did wrong here .
Note: I also tried look at which also have the same result. I am quite confused what I did wrong
Edit : I tried $Sprite.rotation= rad2deg(90.0) and result is strange, it didn’t rotate 90 degress rather it seems to rotate something like 92 degrees. I am scratching my head here