Update custom player property?
Dknighter
✭✭
Hello, I can't seem to work out how to update a custom player property.
I use this to set the property at the start however when I have a button setup to change the property I cannot figure out how to update the property to true, any help would be appreciated.
I am also using this to check each players value.
void Start() { props.Add ("Ready", false); }
I use this to set the property at the start however when I have a button setup to change the property I cannot figure out how to update the property to true, any help would be appreciated.
I am also using this to check each players value.
void OnPhotonCustomRoomPropertiesChanged() { foreach(PhotonPlayer p in PhotonNetwork.playerList) { Debug.Log (p.customProperties.ContainsValue ("Ready")); } }
1
Best Answer
-
Ok turns out I was doing it right, I was reading the value wrong.
Debug.Log (p.customProperties["Ready"]); is the right way to read it.5
Answers
-
Ok turns out I was doing it right, I was reading the value wrong.
Debug.Log (p.customProperties["Ready"]); is the right way to read it.5