customProperties

hi all, please ,help me! new player is connected - сustomproperties all empty!
MY script
[code2=csharp]h.Add("Kill",kills);
h.Add("Dead",deads);
PhotonNetwork.player.SetCustomProperties(h);[/code2]
[code2=csharp]foreach(PhotonPlayer player in PhotonNetwork.playerList){
...
GUILayout.Label(""+player.customProperties["Dead"],style);
...
}
this value is null for new players!!![/code2]
How to fix?
p.s. sorry my English!!!please.

Comments

  • Do you call SetCustomProperties before you enter a room? Or when you are in the room already?
    It takes a moment to sync, so unless every client sets the properties before joining (or creating) a room, then it might be null until synced.
  • Thank you very much for the information!
  • I found that when you call SetCustomProperties while joining a room, custom props might not be synced to the room.
    You should set them before calling join or when you're actually in the room but of course it's not great they could get lost.