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!
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!
0
Comments
-
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 callingSetCustomProperties
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 callAddCallbackTarget
and do not callRemoveCallbackTarget
in the same class...or not callingbase.OnDisable()
when overridingMonoBehaviourPunCallbacks.OnDisable
?
What PUN version are you using?0