Set custom Properties of a room
Hallo. Merry christmas to all
I want to set a room propertie with the code:
Thanks for any help guys.
I want to set a room propertie with the code:
void Awake() { Hashtable setValue = new Hashtable(); setValue.Add("val", turn); PhotonNetwork.room.SetCustomProperties(setValue); }But unfortunately the error occurs: " PhotonNetwork does not contain a definition for ´room´ "
Thanks for any help guys.
0
Best Answer
-
Hi @Paladin83,
Thank you for choosing Photon!
You probably want to use PUN1 or PUN Classic code while having PUN2!
TryPhotonNetwork.CurrentRoom.SetCustomProperties(setValue);
More details about changes between PUN1 and PUN2.5
Answers
-
It seems youre doing this on AWAKE. Is this script being fired before youve entered a room/created a room?0
-
Hi @Paladin83,
Thank you for choosing Photon!
You probably want to use PUN1 or PUN Classic code while having PUN2!
TryPhotonNetwork.CurrentRoom.SetCustomProperties(setValue);
More details about changes between PUN1 and PUN2.5 -
Yes I use PUN2. Thank you it works!0
-
If anyone still got this problem, this worked for me:
ExitGames.Client.Photon.Hashtable setValue = new ExitGames.Client.Photon.Hashtable(); setValue.Add("value", 1); PhotonNetwork.CurrentRoom.SetCustomProperties(setValue);
0