I am working on a multiplayer game using Photon.
I am trying to implement 2v2 matchmaking while playing with a friend.
Random matchmaking is working perfectly fine, and as soon as 4 players join my room, I start the game, and it works. However the problem happens when I try to invite a friend.
I create a custom room (using PhotonNetwork.JoinOrCreateRoom) and send the invitation to my club that contains the room name (any player from my club can accept the invitation and join my room). In the beginning I set the room to IsVisible = false so no one can find it using random matchmaking, and then as soon as someone accepts the invitations and joins the room (again using using PhotonNetwork.JoinOrCreateRoom), I make it IsVisible = true so it becomes visible to random matchmaking. I see that the player that accepts my invitation is in the same room as me and I see the room becoming visible, so this part is working.
However when I try to do random matchmaking with a third player (using PhotonNetwork.JoinRandomRoom), I can’t find that room and he ends up creating his own room instead and I can’t understand why.
If anyone has any hint or wants more information to discuss this issue, it would be very helpful. I’ve been debugging this for days and I still can’t understand why I can’t find that room using regular random matchmaking.
Which version of PUN do you use?
Three things come to my mind here:
a) All clients need to be in the same region. Sometimes best region selection isn’t correct and a client connects to another region.
b) The update of isVisible needs a moment to distribute, so if you quickly JoinRandom, it may (still) fail. Give it a moment.
c) You need each client to have a unique userID. This is the case by default but if you got a login screen which sets the userID, it could be you use the same on multiple clients.
Hi there. I’m getting the same problem and I verified these:
The build and the editor are on the same region (asia). I toasted it and they printed the same region
The is Visible is True and I gave it a moment. Still can’t find.
I don’t have a login screen.
Turn on the SupportLogger and check both logs.
The Matchmaking Checklist is complete. If you don’t find a hint in the logs, send them to developer@photonengine.com.