Check Players In Room
Options
Comments
-
Hi,
yes, it's perfectly doable.
There is a property called PhotonNetwork.PlayerList which will tell you the number of players in the current room.PhotonNetwork.playerList.Length
So this is what you need to show in your UI.
Bye,
Jean0 -
Hi,
yes, it's perfectly doable.
There is a property called PhotonNetwork.PlayerList which will tell you the number of players in the current room.
PhotonNetwork.playerList.Length
So this is what you need to show in your UI.
Bye,
Jean
how to check if there are 2 player in a room ?
if(PhotonNetwork.playerList.Length = 2){
}
is this correct ?0 -
Hi,
there is a player count property inside the room class, so query PhotonNetwork.CurrentRoom.PlayerCount
https://doc-api.photonengine.com/en/pun/v1/class_room.html#a9e7c93f447ab113f8b6f8fed1502b997
Bye,
Jean0