Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide choice to spawn an avatar for the host #283

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
6 changes: 4 additions & 2 deletions examples/forest-brawl/scripts/brawler-spawner.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ extends Node
@export var camera: FollowingCamera
@export var joining_screen: Control
@export var name_input: LineEdit
@export var spawn_host: bool = true

var avatars: Dictionary = {}

Expand All @@ -28,8 +29,9 @@ func _handle_connected(id: int):
joining_screen.visible = false

func _handle_host():
# Spawn own avatar on host machine
_spawn(1)
if (spawn_host):
# Spawn own avatar on host machine
_spawn(1)

func _handle_new_peer(id: int):
# Spawn an avatar for new player
Expand Down