extends Node3D


func _ready() -> void:
	if not multiplayer.is_server():
		return
	spawn_player(multiplayer.get_unique_id())
	for i in multiplayer.get_peers():
		spawn_player(i)

func spawn_player(id) -> void:
	var player: PackedScene = load("res://scenes/player.tscn")
	var inst = player.instantiate()
	inst.name = str(id)
	get_tree().current_scene.add_child.call_deferred(inst,true)
