Lobby
Scene: Lobby/Lobby
The Lobby hosts and joins games through Unity Multiplayer Services, with Relay, so players can connect over the internet without opening ports. The project must be linked to Unity Cloud (see Getting Started).
🎮 Using It
- Type a player name.
- Press Host Duck Shooter or Host Blueprint to create a session. The host loads the game, and joining players follow.
- The Games list shows the open sessions with their player count. Press Refresh to update it, and click a game to join it.
📁 Example Scripts
| Script | Role |
|---|---|
SessionLobby | Signs in anonymously, hosts, joins and leaves a session, then loads the game scene on the host. It sits next to the NetworkManager |
SessionList | Lists the open sessions as buttons and joins the one clicked. Full and locked games are hidden |
| SessionLobby field | Description |
|---|---|
| Max Players | Most players in one session, host included |
| Game Scene | Scene the host loads after creating the session. Set by the host buttons |
| On Joined / On Left / On Status | Events for the UI: joined, left and progress or error messages |
The NetworkManager uses LobbyNetworkPrefabs, the list of every network prefab in both games.