I want to rotate an arc around a point. ..(image 2)
I have done this using the following code.
var turn := 0.0
var radius :=250.0
var speed := 0.25
var angle := 0.0
var str_angle = 5.0
var center
# Called when the node enters the scene tree for the first time.
func _ready():
var screen_size = get_viewport_rect().size / 2
center = screen_size
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta:float) :
position = center + Vector2 (
-sin (angle * speed) ,
cos (angle * speed)
) * radius
func _input(event) :
if event is InputEventMouseMotion :
turn += 1
angle = turn * deg2rad(str_angle)
#self.look_at(center)
#self.rotation_degrees = 5
But the arc angle is not proportional to the center of rotation... (image 1)
I tried to fix the error using the look_at command, but it didn't work
please help me !!!
Thanks.