extends Camera3D

@export_range(0.0, 10.0, 0.1) var smoothness: float = 5.0
@onready var player_position: Node3D = $"../Bubbly/BubblyBody"

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	if player_position:
		# Create target position with player's X and Y, but keep camera's Z
		var target = Vector3(player_position.position.x, player_position.position.y, position.z)
		# Smoothly interpolate the camera's position towards the target position
		position = position.lerp(target, smoothness * delta)
