cawez_puzzlebox/cubes/tile/track_parent.gd
2024-06-27 10:59:57 -04:00

19 lines
546 B
GDScript

extends Node3D
var alpha = 0.05
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if (scale.length() > 0.01):
quaternion = quaternion.slerp(get_node("..").quaternion, 1 - alpha ** delta)
global_position = global_position.lerp(get_node("..").global_position, 1 - alpha ** delta)
scale = scale.lerp(get_node("..").scale, 1 - alpha ** delta)
else:
scale = Vector3.ZERO