- Home /
[Closed]Help with PhotonNetwork.playerList
I try to make a scoreboeard in my Game, i need the List of Players in my Room for my GUI. I tried
foreach(Player pl in PhotonNetwork.playerList){
}
But it gives me this error :The type or namespace name `Player' could not be found. Are you missing a using directive or an assembly reference?
What i am sopused to choose instead of Player. Please excuse my English.
Answer by Zephire · Jul 09, 2014 at 08:27 PM
Try using the below instead
foreach(PhotonPlayer pl in PhotonNetwork.playerList)
{
//Do Something
}
Hope this helps,
Cheers,
Z
Answer by skylem · Sep 22, 2014 at 01:26 PM
if anyone else happens across this a use example could include placing the above in OnGUI and change //do something to the following.
GUILayout.Box(pl.name);
I'm having trouble with this, how could I use this foreach with the photonplayers, and then use it for a regular GUI.Label with a position, not GUILayout.