extends Camera3D | |
var lerp_speed = 3.0 | |
var target_path | |
var offset := Vector3.ZERO | |
var target = null | |
func _ready(): | |
target = get_node(target_path) | |
func _physics_process(delta): | |
if target == null: | |
return | |
var target_pos = target.global_transform.translated_local(offset) | |
global_transform = global_transform.interpolate_with(target_pos, lerp_speed * delta) | |
look_at(target.global_transform.origin, Vector3.UP) | |