Same as prev, but better
This commit is contained in:
parent
ba14ca7ea0
commit
ef5ceb0b95
|
@ -10,6 +10,5 @@ func spawn_player(owner_id: int):
|
||||||
if multiplayer.get_unique_id() == owner_id:
|
if multiplayer.get_unique_id() == owner_id:
|
||||||
var camera := preload("res://camera/camera.tscn").instantiate()
|
var camera := preload("res://camera/camera.tscn").instantiate()
|
||||||
player.add_child(camera)
|
player.add_child(camera)
|
||||||
player.position.y = 5.0
|
|
||||||
return player
|
return player
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,7 @@ extends Node3D
|
||||||
func _ready():
|
func _ready():
|
||||||
# Hacky way to start level without going though multiplayer screens
|
# Hacky way to start level without going though multiplayer screens
|
||||||
if get_parent() == get_tree().root:
|
if get_parent() == get_tree().root:
|
||||||
var player := preload("res://player/player.tscn").instantiate()
|
%PlayerSpawner.spawn(multiplayer.get_unique_id())
|
||||||
player.add_child(preload("res://camera/camera.tscn").instantiate())
|
|
||||||
%Players.add_child(player)
|
|
||||||
|
|
||||||
# Called from the server
|
# Called from the server
|
||||||
func server_add_player(id: int):
|
func server_add_player(id: int):
|
||||||
|
|
Loading…
Reference in New Issue