Checks if the local client has ownership of this object.
true if this client owns the object and can modify it, false otherwise
Checks if Needle Engine networking is connected to a websocket. Note that this is not equal to being connected to a room. If you want to check if Needle Engine is connected to a networking room use the isInRoom property.
true if connected to the websocket.
Checks if anyone (local or remote client) has ownership of this object.
true if someone owns the object, false if no one owns it, undefined if unknown
Cleans up event listeners and resources.
Call this when the OwnershipModel is no longer needed (e.g., in onDestroy()).
Releases ownership of this object, allowing others to take control. Call this when you're done modifying an object to allow other users to interact with it.
this OwnershipModel instance for method chaining
Requests ownership of this object from the networking server.
Ownership may not be granted immediately - check hasOwnership property or use requestOwnershipAsync().
this OwnershipModel instance for method chaining
Requests ownership and waits asynchronously until ownership is granted or timeout occurs.
Promise that resolves with this OwnershipModel when ownership is gained
Requests ownership only if the object is not currently owned by anyone. Internally checks ownership state first, then requests ownership if free.
this OwnershipModel instance for method chaining
Queries the server to update the isOwned state.
Call this to check if anyone currently has ownership.
Manages ownership of networked objects or components.
In multiplayer scenarios, ownership determines which client has authority to modify an object. The networking server rejects changes from clients that don't own an object. This prevents conflicts when multiple users try to manipulate the same object simultaneously.
Ownership states:
hasOwnership: This client owns the object and can modify itisOwned: Some client (could be local or remote) owns the objectundefined: Ownership state is unknown (not yet queried)Typical workflow:
Example: Basic usage
Example: Async ownership
See
SyncedTransform for a complete example of ownership in action
Link
https://engine.needle.tools/docs/networking.html