A practical guide to creating and managing game lobbies with code examples.
PlayFlowLobbyManagerV2
component to a GameObject in your scene. Then, in a script, call the Initialize
method.OnMatchRunning
event. This event provides the IP address and port needed to connect to the game server.
UpdatePlayerState
to sync custom data for the local player, like their ready status or character choice. This data is automatically sent to all other players in the lobby.
lobbyStateRealTime
dictionary from the CurrentLobby
object.
UpdateStateForPlayer(targetPlayerId, data)
KickPlayer(playerId)
UpdateLobby(...)
TransferHost(newHostId)