SetCustomProperties is not updating the room's properties in PUN2

Options
in my code I have the following:
Hashtable colorproperties = new Hashtable();
colorproperties.Add("example", color);
bool Succeed = PhotonNetwork.CurrentRoom.SetCustomProperties(colorproperties);
Debug.Log("Success : " + Succeed);
Debug.Log("CurrentRoom: " + PhotonNetwork.CurrentRoom.ToStringFull());

When this runs the custom properties section of the debug message is blank. What am I doing wrong?

Answers

  • Tobias
    Tobias admin
    edited September 2021
    Options
    Setting properties is done via the server, to not mess with the timing (locally).
    This means that all clients get the update from the server. The sending client will have the same delay in setting the new values as everyone else this way.

    If you'd needed to set the properties locally immediately, create the room with RoomOptions.BroadcastPropsChangeToAll = false. This however means that the clients are not in sync about these values.
    See: Properties Synchronization in the docs.