OnRoomPropertiesUpdate called multiple times on SetCustomProperties

Options
Hi,
i am using SetCustomProperties and the OnRoomPropertiesUpdate callback in order to replicate a few custom properties to all clients. However i realized, for each SetCustomProperties call the OnRoomPropertiesUpdate fires multiple (in my case 14) times on the clients. Is that causing msg/s for each OnRoomPropertiesUpdate fire? Because if so doing the same with RPC instead might be much better in terms of photon resources. Or is there a way of getting OnRoomPropertiesUpdate to fire only once?
Cheers for your help!

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Qianfulong,

    Thank you for choosing Photon!

    The callback should be triggered once per successful properties change.

    There could be two possible explanations:

    1.
    You're probably calling SetCustomProperties too many times.
    Add a log call inside that method to make sure you are calling it once only.

    2.
    OnRoomPropertiesUpdate callback is registered multiple times?
    Maybe you call AddCallbackTarget and do not call RemoveCallbackTarget in the same class...or not calling base.OnDisable() when overriding MonoBehaviourPunCallbacks.OnDisable?

    What PUN version are you using?