Niv
NNormal
•Created by Niv on 3/5/2025 in #🤝ask-a-question
What happens when state changes very close to (or same frame) when the object is destroyed?
Are we guaranteed to get the latest known state to update before the object is destroyed? Or is it possible the object will get destroyed without assuring remote clients "see" the last state of the object before it is destroyed?
14 replies
NNormal
•Created by Niv on 3/3/2025 in #🤝ask-a-question
What is the overhead of RealtimeView components?
I like to keep prefabs in a tidy and verbose hierarchy, but having RealtimeComponents require a RealtimeView component next to each.
what is the overhead from having extra nodes in the hierarchy (meaning extra RealtimeViews that do not need to be in separate gameObjects)?
Like in terms of: bandwidth, model size, computation - is it even slightly significant in any of these factors?
Thanks
7 replies
NNormal
•Created by Niv on 2/26/2025 in #🤝ask-a-question
Not getting ownership changed event when remote authority prevents it
So still with ownership woes ... If I call "RequestOwnershipOfSelfAndChildren" it seems to succeed regardless to the state of 'preventOwnershipTakeover' (which is fine, it might have been removed remotely - and we can always test for that locally if we want).
But if takeover is indeed prevented, it'll restore the ownership state once I assume it gets refused by the server. It seems like in this situation the 'ownerIDSelfDidChange' event of that realtimeView does not get called.
I realize that ownership was never really transfered (as far as the server goes), but locally - that even DOES get triggered when I request ownership, shouldn't it be called again when I am refused?
Is this a bug or intended behavior?
13 replies
NNormal
•Created by Niv on 2/25/2025 in #🤝ask-a-question
preventOwnershipTakeover is not synchronized between clients
I might be missing something very stupid, but this doesn't seem to work for me or I'm not understanding some core concept.
I asked it here before and got confirmation that this value is indeed synchronized between all clients. Meaning when the owner toggles 'preventOwnershipTakeover' it should be reflected on all remote clients as well.
I used the Realtime+CubePlayer example to demonstrate my issue by adding a simple script to the CubePlayer prefab (script attached here).
What it does is simply show the current value of 'preventOwnershipTakeover' of the realtimeView that is next to it.
It also shows the current ownerIDInHierarchy (which synchronized well).
It also allows changing the state of the prevent property, when you are the authority.
moreover, it seems like even when I turn 'preventOwnershipTakeover' on - a remote client is able to to request (and be granted) ownership.
[ Please view attached video ]
Thanks
13 replies
NNormal
•Created by Niv on 2/24/2025 in #🤝ask-a-question
Getting property 'didChange' callbacks but value is identical to previous value.
This seems to happen when other properties in the same RealtimeComponent are changed. Is there any grouping mechanism at play here that causes this?
There's no real 'harm' in applying the same value twice, but in some cases this causes unnecessary work to get done.
43 replies
NNormal
•Created by Niv on 2/23/2025 in #🤝ask-a-question
Accessing the model's 'isRoomConnected', 'isOwnedLocallySelf' during OnRealtimeModelReplaced
Is it allowed to access the properties 'isRoomConnected' or 'isOwnedLocallySelf' (or any other ownership property) inside the OnRealtimeModelReplaced when currentModel is not null?
24 replies
NNormal
•Created by Niv on 2/18/2025 in #🤝ask-a-question
Mixing ownership within a single prefab
I'd like to have mixed ownership within a single Realtime.Instantiate() prefab.
Basically it is made of two parts:
1st part is always owned by the client that created it
2nd part starts ownerd by the creating client but later other clients can request ownership of that part
From the docs it seems like you cannot take ownership of a realtimeView and its components if the parent view is owned by another client. Does that mean I need to put a root RealtimeView with no RealtimeComponents on it that will remain unOwned so I can request ownership of the parts mentioned above?
Any other design pattern offered for mixed ownership?
7 replies
NNormal
•Created by Niv on 7/17/2024 in #🤝ask-a-question
Is there a callback when *any* property of a model changes?
In my RealtimeComponent, I have a relatively big model with several properties, is there a way to get a callback when any property changes instead of creating a didChange callback to every property and subscribing/unsubscribing to it?
14 replies
NNormal
•Created by Niv on 7/7/2024 in #🤝ask-a-question
is the ReltimeView property 'preventOwnershipTakeover' synched between the clients?
Meaning, if clientA takes ownership and the sets the 'preventOwnershipTakeover' property to true - will client 'B' observe that property to be true on his end?
If it is not synchronized and assuming we have a rigidbody with a RealtimeTransform component that clientA prevented ownership changes on - what would prevent client B from requesting ownership on that rigidbody (and immediately receiving it), only for it to be rolled back by the server. This process can happen again and again over multiple frames (as the rigidbody keeps colliding with clientB owned rigidbodies - creating an unnecessarily janky behavior of that rigidbody.
18 replies