Help Me!

Options
Hello, forum users! I'm having a problem with Photon Unity Network! The problem is that I created a multi-level game. When I load the game from the first level, everything works fine, but if I switch to the second level, the OnConnectedToMaster () and OnJoinedLobby () functions stop working and accordingly I can not call the PhotonNetwork.JoinOrCreateRoom function (Application.loadedLevelName, new RoomOptions () TypedLobby.Default); How to be?

Comments

  • Hi @Pub,

    this seems to be a problem with the logic flow in your game. When you are switching to another scene while being inside a room, you don't get OnConnectedToMaster or OnJoinedLobby calls. Furthermore you don't have to call JoinOrCreateRoom when the client is already inside a room. To check if the client is connected to Photon at all you can use the PhotonNetwork.connected condition. If this condition returns false, connect to Photon. If the condition is true, you can check whether the client is in a lobby or in a room by using the PhotonNetwork.insideLobby or PhotonNetwork.inRoom condition.
  • Pub
    Options
    I need to make sure that when you enter a certain zone, a certain player moves to the right room, and the rest stay in his room.