- Home /
photon rematching game doesn't work
I'm using photon to make a mobile online game for 2 players. Now my game load scene when two players are in the lobby, and i can play it well. But when I try to play a new game after I went back to the main menu, the error occurs.
Here's the codes.
This is a code for the exit button after the game is ended.
public void GameExit()
{
PhotonNetwork.Disconnect();
}
And this is a code for LauncherManager.
public override void OnDisconnected(DisconnectCause cause)
{
Debug.LogWarningFormat("PUN Basics Tutorial/Launcher: OnDisconnected() was called by PUN with reason {0}", cause);
PhotonNetwork.LoadLevel("Menu");
}
and this is the error message when I try to match a new game.
JoinRandomRoom failed. Client is on MasterServer (must be Master Server for matchmaking) but not ready for operations (State: Joining). Wait for callback: OnJoinedLobby or OnConnectedToMaster.
I don't understand why client is still on MasterServer.
Please help.
Thanks for reading.
Your answer
![](https://koobas.hobune.stream/wayback/20220613025925im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
PhotonUnityNetworking UnityException 0 Answers
PUN - Choose random Hero for player 0 Answers
How To Destroy An Object Server Side When Using OnTriggerEnter 1 Answer
Photon Combat script does not work 0 Answers
PUN Join/Create menu tutorials 0 Answers