spin.gd 258 B

123456789101112
  1. extends Node3D
  2. var increment := 0.0
  3. func _process(delta: float) -> void:
  4. position.x = sin(increment)
  5. position.z = cos(increment)
  6. # Avoid precision issues over time by rolling over every full turn.
  7. rotation.y = fmod(increment, TAU)
  8. increment += delta