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.

Setting custom player properties?

2020-04-28 16:46:46

I'm trying to load in player weapons from a static scriptable object, and I'm doing this by first:
Adding a custom player property per weapon part
Then, getting the player's custom properties and loading that in

for some reason this doesn't work. The script that does this isn't disabled for other players, should I make it run only if isMine is true?

Here's what I've got so far:

For some reason this doesn't work consistently every time, and sometimes only works for the person who joined first. Anyone know what's wrong?


2020-04-29 15:43:49

Updated my code a bit, works more consistently but still doesn't synchronise a lot of the time.

This method is ran on Start() for every person in the room. I've crammed it into one splittable string now which works a lot more

2020-04-29 16:07:50


2020-04-29 18:56:32


2020-05-01 10:22:13

Hi @LeytonMate,

Did you implement OnPhotonPlayerPropertiesChanged callback?
It will tell you that properties have been updated.

Make sure clients are joined to the same room.
Check error logs.

Side notes (optimization):
Also, can you split this into multiple properties instead of a one with a single long string value?
It's better especially if each part of that string is updated separately individually with different frequencies.
Also you could maybe replace the string value with int/byte/short as index or pointer for enum or actual value on client for efficiency.

2020-05-01 13:34:47

How will I be able to tell that the property that changed was the weapons?

2020-05-04 15:19:47

Also, how can i tell whos properties changed?

2020-05-04 16:54:27

Hi @LeytonMate,

as you can read in the documentation of the callback:

and the hashtable has the key/value pairs that have been changed.

Note: it would help to make some efforts and do some research instead of bump spam.

2020-05-04 17:22:49

I did that, but when comparing it against the PhotonNetwork.player it says it's null?

Back to top