19 lines
545 B
GDScript
19 lines
545 B
GDScript
extends Node3D
|
|
|
|
var alpha = 0.1
|
|
|
|
# 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
|
|
|