Use PlayFab:

Matchmaking - PlayFab

Lobby/Menu scene:

Sample matchmaking flow:

  1. Invite up to 7 other friends into lobby (using Steam API?)
  2. Optionally promote someone else in the lobby to leader
  3. Leader clicks Play → display matchmaking details on UI
  4. Client sends request to matchmaking API → returns an IP
  5. Client sets NetworkManager.networkAddress and calls NetworkManager.StartClient()
  6. Players join game scene (in lobby zone). Server spawns LobbyPlayer Prefabs (set as the Player Prefab on NetworkManager) for all players initially.
  7. When game timer is at 0 and there are enough players, the game starts:
  8. Upon death, display in-game class-selection menu (but monsters this time), update Map<Player, PlayerLoadout> and upon selection, call NetworkServer.ReplacePlayerForConnection() based on the player's choice
  9. When the game ends, server calls backend services to update player gold, leaderboards, game statistics/details, player statistics, etc.
  10. All players disconnect (use NetworkServer.disconnect() perhaps) and join a client menu scene that pulls data from backend services (for updated stats, etc.)