Ryan Green
Ryan Green2mo ago

are all properties on a model updated at the same time?

if I update multiple properties on a model at the same time on the same frame, will they sync to clients at the same time? for example:
[RealtimeModel]
public partial class MonaBodyNetworkIdentifierModel
{
[RealtimeProperty(1, true, true)]
private string _localId;

[RealtimeProperty(2, true, true)]
private string _prefabId;

[RealtimeProperty(3, true, true)]
private bool _locallyOwnedMonaBody;
}
[RealtimeModel]
public partial class MonaBodyNetworkIdentifierModel
{
[RealtimeProperty(1, true, true)]
private string _localId;

[RealtimeProperty(2, true, true)]
private string _prefabId;

[RealtimeProperty(3, true, true)]
private bool _locallyOwnedMonaBody;
}
if I update local, prefab, and locallyOwnedMonaBody at the same time, will all of these properties arrive on a client at the same time?
4 Replies
kapa.ai
kapa.ai2mo ago
Hi @Ryan Green | MONA. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Normcore serializes all updates once per network frame (~20hz) and groups them into the same packet. However, when model updates are applied, they’re applied one at a time, and a change event fires for each value. It’s possible that the other values from that packet hadn’t yet been applied when you log the values on your model from inside of valueDidChange. In order to get an event that fires once all updates have been applied to a model, you can use RealtimeCallback. This means that while all the updates are sent out together, they may not be applied all at once on the receiving client. So, if you update _localId, _prefabId, and _locallyOwnedMonaBody at the same time, they will be sent out in the same packet, but they might not be applied on the client side at the exact same time. You can find more details in the Normcore Documentation (https://normcore.io/documentation/room/common-questions#sometimes-when-i-log-the-values-on-my-model-from-inside-of-valuedidchange-not-all-the-values-that-i-set-on-another-client-update-when-are-updates-sent-out-and-how-are-they-applied). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2mo ago
<@337874773742845953> kapa.ai is still learning and improving, please let us know how it did by reacting below
Ryan Green
Ryan Green2mo ago
@Max this ai assistant is dope
maxweisel
maxweisel2mo ago
right? I wasn’t so sure at first, but I’m a huge fan thumbs down anything that’s bad and we’ll get docs pages written up to improve it