data changes just prior to ClearOwnership() calls
Can I set data on a locally owned model and immediatly follow that with a ClearOwnership() call and still expect that data to be replicated properly across all clients?
5 Replies
Hi @Niv. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
No, you should not expect data changes made just before a ClearOwnership() call to always be replicated properly across all clients. Normcore batches and sends updates at a fixed rate (typically 20Hz), not immediately when you set a property or change ownership. If you set data on a model and then immediately call ClearOwnership(), both changes may be grouped into the same update, or the ownership change could be processed before the data change is sent. This can result in the data update not being sent to the server, especially if the model is no longer owned by your client when the update is processed.
As stated in the documentation:
Normcore doesn’t send changes to the server immediately when you change ownership or the value on a model. Instead, it synchronizes at 20hz and sends the latest state. If you change something and then change it back immediately, nothing will be sent to the server. In this case, skip callingRealtimeTransform Common Questions To ensure your data changes are replicated, you should wait until the next sync frame (or at least a short delay) before calling ClearOwnership(). This gives Normcore time to send the data update to the server while you still own the model. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------ClearOwnership(). As long as the RealtimeView’s owner is None, then any other client in the future can just callRequestOwnership()to take over the transform and move it.
<@269927864265211906> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
I think you can except for RealtimeTransform
@Niv yes you can do this
as long as it was already locally owned. if you call RequestOwnership(), set the data, and call ClearOwnership() all in one frame, and the model is owned remotely, it won't work. the ClearOwnership() call will clear ownership before the request goes out
got it - thanks!