PUN 2 - Get Custom Properties Of Players
Options
Hi everyone,
I tried looking for documentation to find my solution to this but have had no luck. I am trying to access each player's custom properties to check their team.
this is what I want: PhotonNetwork.Player.GetCustomProperties["Team"].ToString();
How can I do this in PUN2?
Thank you!
I tried looking for documentation to find my solution to this but have had no luck. I am trying to access each player's custom properties to check their team.
this is what I want: PhotonNetwork.Player.GetCustomProperties["Team"].ToString();
How can I do this in PUN2?
Thank you!
0
Comments
-
Hi @omard2000,
Thank you for choosing Photon!
You can get the list of players using PhotonNetwork.PlayerList.
For each player (element of that array), you can get the custom properties using Player.CustomProperties.for(int i=0; i<PhotonNetwork.PlayerList.Length; i++) { var team = PhotonNetwork.PlayerList[i].CustomProperties[teamPropKey]; }
1