15 lines
259 B
GDScript3
15 lines
259 B
GDScript3
|
extends Node3D
|
||
|
|
||
|
@export var interpolate: bool
|
||
|
@export var speed: float
|
||
|
|
||
|
func _process(delta):
|
||
|
if Global.player == null:
|
||
|
return
|
||
|
|
||
|
if interpolate:
|
||
|
position = lerp(position, Global.player.position, speed * delta)
|
||
|
else:
|
||
|
position = Global.player.position
|
||
|
|