Hello
I have been cracking my head today against the possibly the simplest thing ever in Photon but I just seem to be unable to get the idea.
Situation:
Two players in a room. They choose a character and set a local bool to true. I add this bool in a hashtable and then I set the customerproperties by .SetCustomProperties. Then I want to instantiate the players' characters ONCE everybody has chosen his character. I am tryign to check this with
foreach (PhotonPlayer photonPlayer in PhotonNetwork.playerList) {
if ((bool)photonPlayer.CustomProperties ["ReadyRace"]) {
}
}
but it throws a Null reference on the IF Statement line. I am pretty sure this is not the right way to check if the bool set is true or false but my question is: How do you check the value of a key in a hashtable?
I have been cracking my head today against the possibly the simplest thing ever in Photon but I just seem to be unable to get the idea.
Situation:
Two players in a room. They choose a character and set a local bool to true. I add this bool in a hashtable and then I set the customerproperties by .SetCustomProperties. Then I want to instantiate the players' characters ONCE everybody has chosen his character. I am tryign to check this with
foreach (PhotonPlayer photonPlayer in PhotonNetwork.playerList) {
if ((bool)photonPlayer.CustomProperties ["ReadyRace"]) {
}
}
but it throws a Null reference on the IF Statement line. I am pretty sure this is not the right way to check if the bool set is true or false but my question is: How do you check the value of a key in a hashtable?