Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AndreaCatania/f8d307d5fd694b548e465eae3b2ff088 to your computer and use it in GitHub Desktop.
Save AndreaCatania/f8d307d5fd694b548e465eae3b2ff088 to your computer and use it in GitHub Desktop.
extends MeshInstance3D
var velocity: Vector3 = Vector3(2, 0, 0)
var interval: float = 0.0
func _ready():
SceneRewinder.register_variable(self, "translation")
SceneRewinder.register_variable(self, "velocity")
SceneRewinder.register_variable(self, "interval")
SceneRewinder.register_process(self, "process_motion")
func process_motion(delta):
interval += delta
if interval > 1.0:
interval = 0.0
velocity = velocity.rotated(Vector3(0, 0, 1), deg2rad(90))
translation += velocity * delta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment