16 lines
467 B
GDScript
16 lines
467 B
GDScript
extends Node3D
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
pass # Replace with function body.
|
|
|
|
|
|
@export var follow_speed: float = 5.0
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta: float) -> void:
|
|
var target_position = global_transform.origin # Camera's world position
|
|
global_transform.origin = lerp(global_transform.origin, target_position, follow_speed * delta)
|