playerList returns localPlayer only

playerList returns local player only
foreach (PhotonPlayer player in PhotonNetwork.playerList)
        {
            textBox.text += "\r\n Player" + Random.Range(1, 9999);
        }

Comments

  • For multiple players in list, client calling PhotonNetwork.playerList should be joined to the room and at least one other client should be joined same room.
  • GameDevKev
    edited January 2016
    Gotcha, I was trying to list players in lobby, as it is stated many times by photon staff that the lobby is a room, but after much research I have found that photon deliberately restricts you from getting a player list from the lobby, the reason being "you might not know what you are doing and list too many players..."
  • PhotonNetwork.playerList is a list of players in the room. Of course it does not work in lobby. Probably you need method for getting all users joined to the lobby or joined to rooms created in this lobby. Photon does not support this. You may only query known users states with FindFriends from lobby.
  • GameDevKev
    edited January 2016
    What had me confused was admin describing the lobby as 'just another room'. So seeing as this is false, it makes more sense to me now. But yes, you guys should definitely write a method for the lobby player list. It's not necessarily so you can find friends, but it would definitely help with that too. In my hours of searching I found many people asking the same or similar questions looking for playerlist.
  • We would like to give you all the info everywhere but that means there's a lot of room for errors on either side and the traffic could become an issue, too.

    You say that we described the lobby as a room "often". Do you remember one or two places?
    It's similar, because you join it and can leave but aside from that, it's very different. I would like to clarify that.