## A dolly tweens all contents to and from two destination points, and to its origin. class_name Dolly extends Node3D @export var start_arrived : bool = false @export var arrival_time : float = 10.0 @export var leave_time : float = 12.0 @onready var origination : Node3D = $Origination @onready var destination : Node3D = $Destination var tween : Tween = null func _ready() -> void: if not start_arrived: for child in get_children(true): if not child.visible: continue child.global_position = origination.global_position func arrive() -> void: if tween: tween.kill() tween = create_tween().set_trans(Tween.TRANS_CIRC).set_ease(Tween.EASE_OUT) for child in get_children(true): if not child.visible: continue tween.parallel().tween_property(child, "global_position", self.global_position, arrival_time) func leave() -> void: if tween: tween.kill() tween = create_tween().set_trans(Tween.TRANS_QUART).set_ease(Tween.EASE_IN) for child in get_children(true): if not child.visible: continue tween.parallel().tween_property(child, "global_position", destination.global_position, leave_time)