JoinOrCreateRoom throws an error.

Hello.

I've got the following error trying to Create or Join a new room:

JoinOrCreateRoom failed. Client is not on Master Server or not yet ready to call operations. Wait for callback: OnJoinedLobby or OnConnectedToMaster.
UnityEngine.Debug:LogError(Object)

in my code i'm leaving a room, and right after that i'm trying to join or create another room.

Where's the problem?

Comments

  • The error pretty much sums it up. You have to wait for the either callback to be called.
    PUN is hiding this but in the background it will hop between servers when you join and leave rooms.
    This hopping takes a moment, so you can't call join while PUN is switching.

    See "Connecting, Master Server And Lobby"

    Hope that helps.
  • thanks for your reply!