You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
471 B
GDScript

extends Camera3D
@export var Player: Player
var PlayerLastPos
# Called when the node enters the scene tree for the first time.
func _ready():
PlayerLastPos = Player.position
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta):
position.x += (Player.position.x - PlayerLastPos.x)
position.y += (Player.position.y - PlayerLastPos.y)
position.z += (Player.position.z - PlayerLastPos.z)
PlayerLastPos = Player.position