Trying to understand ownership of transforms vs views
Conceptually what does it mean if an object has both a RealtimeView and a RealtimeTransform, but they're owned by different clients? eg if I own the transform and no one owns the View, or I own the transform but someone else owns the view?
4 Replies
Hi @kyle. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Great question! In Normcore, ownership is hierarchical and enforced by the server. Here’s how it works conceptually when you have both a RealtimeView and a RealtimeTransform on the same object:
1. If you own the RealtimeTransform, but no one owns the RealtimeView
- You can move the object: If the RealtimeView is unowned (ownerID = -1), then any client can request ownership of child components like RealtimeTransform. If you own the RealtimeTransform, your client is the source of truth for the transform’s state (position, rotation, etc.), and your changes will be synchronized to all other clients.
- Others can take over: Since the RealtimeView is unowned, other clients can also request ownership of the RealtimeTransform at any time. There’s no restriction from the parent view.
Ownership of the RealtimeView acts as a gatekeeper for all child components. If the view is unowned, ownership of child components is flexible. If the view is owned, only the owner of the view can own or modify its children. If you need more granular control, you can assign ownership at the component level, but only if the parent view is unowned or owned by the same client. Let me know if you want more details or examples! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
"By default, a model has anOwnership + Lifetime Flags 2. If you own the RealtimeTransform, but someone else owns the RealtimeView - You cannot actually own the transform: If the RealtimeView (the parent) is owned by another client, you cannot take ownership of the RealtimeTransform (the child). The server enforces that only the owner of the parent can own or modify its children. If you try to request ownership of the RealtimeTransform, the server will reject it, and any changes you make will be rolled back. - The parent’s owner is authoritative: Only the client that owns the RealtimeView can make changes to it or any of its child components, including the RealtimeTransform.ownerID
of-1
, which denotes that it has no owner. When a model is unowned, it can be modified by anyone in the room. However, when a model is owned by a client, the server only lets the owning client make changes to it or to any of its child models."
"The ownership settings of a parent are enforced on all children. If a model is owned by one client, all other clients are blocked from making changes to the model or any of its child models."Ownership + Lifetime Flags
"ARealtimeTransform Summary Table | RealtimeView Owner | RealtimeTransform Owner | Who can move the object? | |--------------------|------------------------|----------------------------------| | None | You | You (others can take over) | | Other client | You (attempted) | Not possible; only parent owner | | You | You | You | Key Concept:RequestOwnership()
call is only rejected if the RealtimeView or a parent RealtimeView is owned by a different client."
Ownership of the RealtimeView acts as a gatekeeper for all child components. If the view is unowned, ownership of child components is flexible. If the view is owned, only the owner of the view can own or modify its children. If you need more granular control, you can assign ownership at the component level, but only if the parent view is unowned or owned by the same client. Let me know if you want more details or examples! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
<@401595391549898754> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Is the RealtimeTransform in my example still considered a "child" even if it's on the same GameObject?
yes. anything on the components or child views list is a child of the RealtimeView’s model