• 2D
  • I need some help making a clock.

I have 7 days experience with godot. I am working on a game that builds upon a clock. Right now I struggle to make the pointer on the watch rotate the way I want it to. For my pointer scene, I have used the following code:

extends KinematicBody2D
var rotateSpeed = 0



func _physics_process(delta):
	rotateSpeed += 3
	rotation_degrees = rotatingspeed

I have understood that the function "func _physics_process" is called 60 times each second, so with the following code the rotation to the sprite will increase with 3 every frame. So this technique does not increase the speed, just how much the object rotates every frame. So if I want to "increase the speed" by increasing the increment on "rotateSpeed" the pointer will not move smooth :)

How can I make the pointer rotate smoothly, and also have a variable that controls the speed.

Thank you in advance!

I found a solution to this. Thanks.

What was the solution? Ideal would be to use delta. var change=rotateSpeed * delta rotation_degrees+=change

I do understand your logic for using the 60 frames per second ideal. But using delta is the main stream method for controling such things.

Using my example above, if you wanted full rotation every minute, then rotateSpeed should be 60.