ownership transfer requiring to clear in instantiated objects?
objects that are already in scene view are fine, but when i instantiate an object through and i try to transfer ownership from one client to another, it requires a clear?
5 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:
i may be stupid
----------------------
When you instantiate an object using
Realtime.Instantiate()
with preventOwnershipTakeover=false
, ownership transfer should not require a manual call to ClearOwnership()
—any client should be able to call RequestOwnership()
to take over ownership of the object. The preventOwnershipTakeover
flag, when set to false
, allows ownership to be transferred freely at runtime. If it were set to true
, then the current owner would need to clear ownership before another client could take it over, but that's not the case in your code snippet.
Here's the relevant documentation:
By default, anyone can request ownership of a RealtimeView at runtime. The server will approve this request unless a parent RealtimeView is already owned by another client. However, this can be controlled with thePrevent ownership takeover of a RealtimeView And:preventOwnershipTakeover
flag. When this flag is true on any model, the server will deny any client’s attempt to change the ownership of an object in that model unless it has no owner.
It's worth noting thatRequesting ownership of a RealtimeView If you are experiencing a situation where you must callRequestOwnership()
andClearOwnership()
take effect immediately, but if the server blocks the request—say, becausepreventOwnershipTakeover
istrue
or because the view's parent is owned by another client—then ownership and all changes that required ownership will be rolled back.
ClearOwnership()
before another client can take ownership, double-check that:
- The preventOwnershipTakeover
flag is indeed set to false
on the instantiated object.
- There is no parent RealtimeView with ownership or with preventOwnershipTakeover
enabled.
- The ownership logic is not being overridden elsewhere in your code.
Objects already in the scene may behave differently if their ownership flags are set differently in the editor. For instantiated objects, the flags you pass to Realtime.Instantiate()
should control this behavior.
If you continue to see this issue despite the correct flag settings, there may be a problem elsewhere in your setup, but according to the documentation, with preventOwnershipTakeover=false
, ownership transfer should not require a manual clear.
----------------------
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.
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm