cave-of-dreams/scripts/player_camera.gd

11 lines
312 B
GDScript

extends Camera3D
@onready var player = get_parent().get_node("Player")
@onready var offset = position - player.position
func _ready() -> void:
pass
func _process(delta: float) -> void:
var goal_position = player.global_position + offset
global_position += (goal_position - global_position) / (500 * delta)