Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | mrkaio |
Hello,
I do not know how to rotate a object around the origin. A local rotation is no problem but the rotation around the origin does not work…
If it is possible I like to use Transform2D because it is available to all Nodes2D
Here is an example code:
extends Sprite
func _ready():
var v = Transform2D()
v = v.rotated(PI/2)
v = v.translated( Vector2(100,0) )
v[2] += Vector2(100,0)
self.transform = v
I like to rotate the sprite around Vector2(100,0) with a distance of Vector2(100,0)
I guess the solution is one line but I am not able to find it in the documentation…