extends Node3D

const multiplayer_pc_template = preload("res://templates/multiplayer_pc.tscn")
const camera_template = preload("res://templates/camera.tscn")
@onready var player_spawner = %Spawner
func _ready() -> void:
	print("LEVEL LOADING, ID: " + str(Multiplayer.id) + " with " + str(Multiplayer.players.size()) + " keys recognized")
	if Multiplayer.is_server():
		for key in Multiplayer.players.values():
			var pc = multiplayer_pc_template.instantiate()
			player_spawner.add_player(pc, key)
			pc.setup(key)
	var camera = camera_template.instantiate()
	add_child(camera)
