migrating from photon
i call RealtimeView.RequestOwnership() and it just doesnt happen. doesnt give me any errors or anything
8 Replies
Hi @ev. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
A few common Normcore gotchas can make RequestOwnership feel like it “does nothing.” Here’s a focused checklist to help you debug:
1) Make sure the view actually has a model yet
- For scene RealtimeViews, they register in Start(). If you call RequestOwnership() too early, you’ll hit the “no model yet” case and ownership won’t change. Wait until realtime.connected == true or after didConnectToRoom, or call from Start/after Start rather than Awake. [RealtimeView FAQ] 2) Check parent ownership and preventOwnershipTakeover
- The server will reject a takeover if a parent RealtimeView is owned by someone else, or if preventOwnershipTakeover is true anywhere in the hierarchy. In those cases, requests are optimistically applied client-side and then rolled back silently if the server denies them. [RealtimeTransform; Prevent takeover; Requesting ownership of a RealtimeView] 3) Verify you’re requesting ownership on the right component
- For movement, ownership needs to be on the RealtimeTransform (not just the RealtimeView). If the view is owned by someone else, RealtimeTransform RequestOwnership() can still be rejected due to hierarchy ownership. If you want collision-based handoff, ensure the RealtimeView remains unowned. [RealtimeTransform; RealtimeTransform FAQ] 4) If it’s a custom RealtimeComponent/RealtimeModel
- Ownership only works if the model was compiled with a meta-model. Add [RealtimeModel(createMetaModel: true)] to your model attribute; otherwise ownership calls won’t affect anything. [Requesting ownership of any…; RealtimeModel methods] 5) Timing on prefabs vs scene objects
- Prefab views are ready by Start on the prefab instance. Scene views might not be ready until after they register with Realtime; wait for the room to connect or use didConnectToRoom before interacting with ownership. [RealtimeView FAQ] 6) How to quickly validate at runtime
- Use the RealtimeView inspector buttons (Request Ownership / Clear Ownership) in Play mode to see if the request sticks. If it doesn’t, it’s likely being denied due to hierarchy ownership or preventOwnershipTakeover. [Requesting ownership of a RealtimeView; RealtimeView editor] Practical steps: - Ensure you call RequestOwnership() after the view is registered (e.g., after didConnectToRoom). - Check realtimeView.isOwnedLocallyInHierarchy and preventOwnershipTakeover in the inspector at runtime. - If you only need to move an object, call realtimeTransform.RequestOwnership() and leave the parent RealtimeView unowned. [RealtimeTransform; RealtimeTransform FAQ] If you share a snippet showing where you call RequestOwnership() (Awake/Start/after connect) and whether this is a scene object or a prefab, I can help pinpoint which of the above is the culprit. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
- For scene RealtimeViews, they register in Start(). If you call RequestOwnership() too early, you’ll hit the “no model yet” case and ownership won’t change. Wait until realtime.connected == true or after didConnectToRoom, or call from Start/after Start rather than Awake. [RealtimeView FAQ] 2) Check parent ownership and preventOwnershipTakeover
- The server will reject a takeover if a parent RealtimeView is owned by someone else, or if preventOwnershipTakeover is true anywhere in the hierarchy. In those cases, requests are optimistically applied client-side and then rolled back silently if the server denies them. [RealtimeTransform; Prevent takeover; Requesting ownership of a RealtimeView] 3) Verify you’re requesting ownership on the right component
- For movement, ownership needs to be on the RealtimeTransform (not just the RealtimeView). If the view is owned by someone else, RealtimeTransform RequestOwnership() can still be rejected due to hierarchy ownership. If you want collision-based handoff, ensure the RealtimeView remains unowned. [RealtimeTransform; RealtimeTransform FAQ] 4) If it’s a custom RealtimeComponent/RealtimeModel
- Ownership only works if the model was compiled with a meta-model. Add [RealtimeModel(createMetaModel: true)] to your model attribute; otherwise ownership calls won’t affect anything. [Requesting ownership of any…; RealtimeModel methods] 5) Timing on prefabs vs scene objects
- Prefab views are ready by Start on the prefab instance. Scene views might not be ready until after they register with Realtime; wait for the room to connect or use didConnectToRoom before interacting with ownership. [RealtimeView FAQ] 6) How to quickly validate at runtime
- Use the RealtimeView inspector buttons (Request Ownership / Clear Ownership) in Play mode to see if the request sticks. If it doesn’t, it’s likely being denied due to hierarchy ownership or preventOwnershipTakeover. [Requesting ownership of a RealtimeView; RealtimeView editor] Practical steps: - Ensure you call RequestOwnership() after the view is registered (e.g., after didConnectToRoom). - Check realtimeView.isOwnedLocallyInHierarchy and preventOwnershipTakeover in the inspector at runtime. - If you only need to move an object, call realtimeTransform.RequestOwnership() and leave the parent RealtimeView unowned. [RealtimeTransform; RealtimeTransform FAQ] If you share a snippet showing where you call RequestOwnership() (Awake/Start/after connect) and whether this is a scene object or a prefab, I can help pinpoint which of the above is the culprit. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
<@419782903405215744> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
also any object with a realtime transform is just frozen and it doesnt have any physics. i think its because nobody owns it in the room but i cant really own it anyway
You need to request ownership of the RealtimeTransform and make sure Maintain Ownership While Sleeping is true if the body is at rest
alright ill try that, thanks
sure thing!
got it to work yippee
great! glad to hear it 🙂 let us know if you have any other questions