extends Node3D

@export_file("*.tscn") var scene_to_load: String
@onready var audio = $AudioStreamPlayer3D
@onready var area = $Area3D

func _on_body_entered(body: Node3D) -> void:
	if body.is_in_group("Player"):
		if scene_to_load:
			audio.play()
			body.player_win()
			await audio.finished
			get_tree().change_scene_to_file(scene_to_load)
