/
OrchestraNotPlay
/
EnergyDron
Обзор
Документация
Войти
/
OrchestraNotPlay
/
EnergyDron
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
src/camera/camera_3d.gd
23 строки
582 B
OrchestraNotPlay
feat: implement inertion for the player.tscn
24 апр 2026, 14:02
24 апр 2026, 14:02
488fc39
Код
Авторство
О чём код?
extends Camera3D @export var target_path: NodePath @export var offset: Vector3 = Vector3(0, 5, 10) @export var smooth_speed: float = 5.0 var target: Node3D # Called when the node enters the scene tree for the first time. func _ready() -> void: target = get_node(target_path) # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: if not target: return var target_pos = target.global_position + offset global_position = global_position.lerp(target_pos, smooth_speed * delta) look_at(target.global_position)