Improved camera
This commit is contained in:
14
client/camera/FollowPlayer.gd
Normal file
14
client/camera/FollowPlayer.gd
Normal file
@ -0,0 +1,14 @@
|
||||
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
|
||||
|
Reference in New Issue
Block a user