enter code here
Hi guys, so I have this problem, I want to display all players in the lobby, but for some reason I can not get my code to work
can anyone please help, I am sure I’m making a very stupid mistake. Here is my code
foreach( PhotonPlayer Pplayers in PhotonNetwork.playerList)
{
GUILayout.Label(Pplayers.name);
}
For some reason it just does not want to work???
The PhotonNetwork.playerList is only available while in a room, not in the lobby (now better described in the API reference).
The clients don’t get a list of players looking for a game. This could be thousands potentially, which is too much to list (and too much to digest as user!).
In a lobby, you can get the count of users looking for games: PhotonNetwork.countOfPlayersOnMaster. You can also show how many games there are: PhotonNetwork.countOfRooms (even without entering the lobby, which gets you the rooms list).