|
@@ -237,8 +237,11 @@ In our case, we simply need to multiply our 'rotation_ang' variable by 'delta' i
|
|
func _process(delta):
|
|
func _process(delta):
|
|
angle_from += rotation_ang * delta
|
|
angle_from += rotation_ang * delta
|
|
angle_to += rotation_ang * delta
|
|
angle_to += rotation_ang * delta
|
|
- angle_from = wrap(angle_from, 0, 360)
|
|
|
|
- angle_to = wrap(angle_to, 0, 360)
|
|
|
|
|
|
+
|
|
|
|
+ # we only wrap angles if both of them are bigger than 360
|
|
|
|
+ if (angle_from > 360 && angle_to > 360):
|
|
|
|
+ angle_from = wrap(angle_from, 0, 360)
|
|
|
|
+ angle_to = wrap(angle_to, 0, 360)
|
|
update()
|
|
update()
|
|
|
|
|
|
Let's run again! This time, the rotation displays fine!
|
|
Let's run again! This time, the rotation displays fine!
|