Get the player in the room

Options
Hi

I want to create a chart to display the name, kill and deaths of each player, you know the very basic for a deathmatch multiplayer game, so I need a way to get who is in the room so I can get their ID's, is there any method in PUN to do this?

Comments

  • vadim
    Options
    Hi,

    Try PhotonNetwork.FindFriends() while client is in lobby.
  • Hi,

    Thanks, I noticed there is also "PhotonNetwork.playerList" whats the difference between the two? , also I noticed PhotonPlayer has many of the usual properties like Score, Team, etc already integrated, so I wonder if playerList is already sorted with the players with more points on top to make a score chart or is there anything like that so I dont have to make mine.
  • vadim
    Options
    PhotonNetwork.playerList is unsorted list of players in currently joined room.
    PhotonNetwork.FindFriends() asks currently joined lobby about statuses of players with given names.

    PhotonPlayer does not have those properties. All player properties set with player.SetCustomProperties and get via player.customProperties
    UtilityScripts folders contains helpers for Score and Team which use player custom properties inside.