I’m trying to implement a matchmaking system.
If there are four players who have access to the room, I’d like to start the game and keep the loading window on.
PhotonNetwork.CountOfPlayers
I can get the number of players in the current room, but I don’t know when to bring this.
OnJoinedRoom(){
}
This function also runs only on the first-time MasterClient.
What the hell should I do?
The “Basics Tutorial” actually covers this case. Use the callback OnPlayerEnteredRoom.
Whenever someone joins, this triggers.
When you create a room, set MaxPlayers to 4 and close the room when the game starts (so nobody can join later).
Also see the Matchmaking Guide.