Joinrandomroom issue
Options
My game has a multiplayer mode. I use the joinRandomRoom function to create or join room. My room maximum
player count is 2. If A player and B player press the joinRandomRoom button in the same time. They cannot search any player. How can I search player if press the button in the same time
player count is 2. If A player and B player press the joinRandomRoom button in the same time. They cannot search any player. How can I search player if press the button in the same time
0
Comments
-
Hi @manlok1992,
PhotonNetwork.JoinRandomRoom() only joins a room if there is one available. It doesn't create a room if it fails. In case of failure the OnPhotonRandomJoinFailed callback is executed. So I would recommend you to implement this callback in order to process anyway, for example by using PhotonNetwork.CreateRoom(...) so that the clients creates a room himself another client can join later.0 -
Hi @manlok1992,
Thank you for choosing Photon!
In case what you are asking is the following:
"why sometimes you can't match players if they try random matchmaking at the same time"
Then:
this is a known issue. it should be gone when you have more testers or more players in production. as a workaround, wait after few seconds before trying to find a match from second player.0 -
I have implement the createRoom function in the joinRoomFailed. I meant if I press button in the same time, these 2 players will be create two rooms. I want a player is create room, another player is join room.Christian_Simon said:Hi @manlok1992,
PhotonNetwork.JoinRandomRoom() only joins a room if there is one available. It doesn't create a room if it fails. In case of failure the OnPhotonRandomJoinFailed callback is executed. So I would recommend you to implement this callback in order to process anyway, for example by using PhotonNetwork.CreateRoom(...) so that the clients creates a room himself another client can join later.0 -
@manlok1992,
As I mentioned above:this is a known issue. it should be gone when you have more testers or more players in production. as a workaround, wait after few seconds before trying to find a match from second player.0 -
@JohnTube
I know your solution. But my director want to fix this issue. But I don't have any way to fix it.0