extends LocalCam

@export var min_bound:Vector2
@export var max_bound:Vector2

var player:Player

func _ready() -> void:
	player = get_tree().get_first_node_in_group("Player")


func _process(_delta: float) -> void:
	if is_current():
		global_position = player.global_position
		if position.x < min_bound.x: position.x = min_bound.x
		elif position.x > max_bound.x: position.x = max_bound.x
		
		if position.y < min_bound.y: position.y = min_bound.y
		elif position.y > max_bound.y: position.y = max_bound.y
