Added a settings menu
This commit is contained in:
@ -1,18 +1,25 @@
|
||||
extends Camera3D
|
||||
|
||||
@export var follow: Node3D
|
||||
@export var pivot: Node3D
|
||||
@export_group("Main")
|
||||
@export var follow_node: Node3D
|
||||
@export var pivot_node: Node3D
|
||||
|
||||
@export_group("Follow")
|
||||
@export var follow_enabled: bool
|
||||
@export var follow_speed: float
|
||||
|
||||
func _ready():
|
||||
Global.camera = self
|
||||
look_at(pivot.position)
|
||||
look_at(pivot_node.position)
|
||||
|
||||
func _process(delta):
|
||||
if Global.player == null:
|
||||
return
|
||||
|
||||
follow.position = lerp(follow.position, Global.player.position, follow_speed * delta)
|
||||
if follow_enabled:
|
||||
follow_node.position = lerp(follow_node.position, Global.player.position, follow_speed * delta)
|
||||
else:
|
||||
follow_node.position = Global.player.position
|
||||
|
||||
# @export var shake_strength: float
|
||||
# var noise = FastNoiseLite.new()
|
||||
|
Reference in New Issue
Block a user