hotel-madness/scripts/maps/map.gd

13 lines
366 B
GDScript

extends Node3D
var player: PackedScene = preload("res://scenes/entities/player.tscn")
func _ready() -> void:
var spawns: Array = $PlayerSpawn.get_children()
var i: int = 0
for peer: String in Networking.peers:
var instance: CharacterBody3D = player.instantiate()
instance.position = spawns[i].position
instance.name = peer
add_child(instance)
i += 1