The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

Try Our

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

PUN 2 - Get Custom Properties Of Players

2018-12-25 17:33:59

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!


2018-12-25 20:30:12

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

2018-12-26 00:58:03

@JohnTube Thank you! :smiley:

Back to top