16 lines
427 B
GDScript3
16 lines
427 B
GDScript3
|
extends MultiplayerSpawner
|
||
|
|
||
|
func _ready():
|
||
|
set_multiplayer_authority(1)
|
||
|
spawn_function = spawn_player
|
||
|
|
||
|
func spawn_player(owner_id: int):
|
||
|
var player := preload("res://player/player.tscn").instantiate()
|
||
|
player.set_multiplayer_authority(owner_id)
|
||
|
if multiplayer.get_unique_id() == owner_id:
|
||
|
var camera := preload("res://camera/camera.tscn").instantiate()
|
||
|
player.add_child(camera)
|
||
|
player.position.y = 5.0
|
||
|
return player
|
||
|
|