Ethan Barron
Ethan Barron3w ago

Bizarre RealtimeTransform behaviour

Sorry I've had to get off tonight, but I'm able to give more information tomorrow I've got a scenario with some interactables, and the flow is basically User presses E to pickup > Instant RequestOwnership on the interactable's RealtimeTransfork > OnGrabbed UnityEvent fired for any listeners This works absolutely perfectly when in a room on my own, but for some reason when I'm in a room with others multiple things happen - RealtimeTransform in editor says I'm owner - isOwnedLocallySelf (or whatever it is) seems to be false on the NetworkTransform - NetworkTransform.realtime and NetworkTransform.realtimeView always return null - Even if another player owns the NetworkTransform, the editor says that I own it I think for some reason clients could be playing a game of tug-of-war even if that situation isn't created? - The NetworkTransform has a rigidbody attached - The NetworkTransform isn't instantiated at runtime, it's on a scene object - I'm in a room when all of this takes place, so I'm not running any online related methods like RequestOwnership while offline - The RealtimeView is never owned by anyone since its a shared object that others can snatch freely, the only thing owned is the NetworkTransform Again I apologise for not being able to share much, will absolutely do so tomorrow
4 Replies
kapa.ai
kapa.ai3w ago
Hi @Ethan Barron. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on your description, several key points from the Normcore documentation are directly relevant to the issues you’re seeing with RealtimeTransform and ownership: 1. Scene Objects and Initialization For scene objects (not instantiated at runtime), you must wait until the room is connected before interacting with RealtimeView or RealtimeComponent properties like realtime, realtimeView, or ownership status. Accessing these before the connection is established can result in them being null or reporting incorrect ownership states. Make sure you only check these properties after realtime.connected == true or after the didConnectToRoom event has fired. This is especially important for scene objects, as their models are not available until the room is connected (source). 2. Ownership Model - RealtimeView: If the RealtimeView is unowned (which is recommended for shared interactables), then ownership of the RealtimeTransform can be transferred freely between clients. Only the owner of the RealtimeTransform can move it; others will see the owner’s updates. - RequestOwnership: You should only need to call RequestOwnership() on the RealtimeTransform, not the RealtimeView, for this use case. If you request ownership on both, it can cause conflicts and prevent proper handoff (source). - Tug-of-war: If multiple clients are calling RequestOwnership() rapidly, or if ownership is not being properly cleared (e.g., after dropping an object), you can get a "tug-of-war" effect. Make sure you’re not calling ClearOwnership() immediately after moving, as changes are only sent at 20Hz and may not propagate (source). 3. Rigidbody Mode - When a Rigidbody is present, RealtimeTransform synchronizes world position/rotation and handles ownership differently. It will clear ownership when the Rigidbody goes to sleep unless you set "Maintain Ownership While Sleeping" in the inspector (source). - If you want to keep ownership after dropping or when the object is at rest, ensure this setting is enabled. 4. Editor Inspector Confusion - The Unity editor inspector may not always reflect the true networked state, especially if you’re inspecting the object before the room is connected or if you’re looking at a local-only state. Always verify ownership and connection status in code after the room is connected. Recommendations - Ensure you only interact with ownership and RealtimeTransform after the room is connected. - Only call RequestOwnership() on the RealtimeTransform, not the RealtimeView, for shared interactables. - Avoid calling ClearOwnership() immediately after moving the object. - If you want to maintain ownership while the Rigidbody is sleeping, enable "Maintain Ownership While Sleeping" on the RealtimeTransform. - Double-check that your logic for picking up and dropping objects is not causing rapid ownership changes. If you continue to see realtime or realtimeView as null after the room is connected, or if ownership states are inconsistent, please share a minimal code sample and inspector setup for further troubleshooting. For more details, see the following documentation: - RealtimeTransform: Ownership and Rigidbody Mode - Common Questions: RealtimeTransform Ownership - Ownership and Lifetime Flags ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3w ago
<@540897871545892884> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Ethan Barron
Ethan BarronOP3w ago
Figured out the issue, it was an artifact of me handling the synchronization of the grab event unreliably
maxweisel
maxweisel2w ago
glad to hear you got it sorted!

Did you find this page helpful?