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.

Set custom Properties of a room

2018-12-27 18:24:20

Hallo. Merry christmas to all :)
I want to set a room propertie with the code:

void Awake()  
            Hashtable setValue = new Hashtable();  
            setValue.Add("val", turn);  

But unfortunately the error occurs: " PhotonNetwork does not contain a definition for ´room´ "

Thanks for any help guys.


2018-12-28 05:35:43

It seems youre doing this on AWAKE. Is this script being fired before youve entered a room/created a room?

2018-12-28 10:02:04

Hi @Paladin83,

Thank you for choosing Photon!

You probably want to use PUN1 or PUN Classic code while having PUN2!
Try PhotonNetwork.CurrentRoom.SetCustomProperties(setValue);

More details about changes between PUN1 and PUN2.

2018-12-28 10:06:16

Yes I use PUN2. Thank you it works!

2021-10-12 17:13:58

If anyone still got this problem, this worked for me:

Back to top