16 lines
462 B
GDScript
16 lines
462 B
GDScript
## SPDX-License-Identifier: GPL-3.0-or-later
|
|
## Copyright (c) 2024 interstellardevelopment.org
|
|
|
|
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
|