Created
April 24, 2020 05:52
-
-
Save AndreaCatania/f8d307d5fd694b548e465eae3b2ff088 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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