Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/_docs/the-basics/object-ownership.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Object Ownership
permalink: /wiki/object-ownership/
---

Each NetworkedObject is be owned by a specific client. This can be any client or the server.
Each NetworkedObject is owned by a specific client. This can be any client or the server.

Giving ownership of an object can be done like this
```csharp
Expand All @@ -15,10 +15,10 @@ The default behavior is that an object is owned by the server. To give ownership
GetComponent<NetworkedObject>().RemoveOwnership();
```

When you are owner of an object. You can check for ``IsOwner`` in any NetworkedBehaviour, similar to how player objects can do ``IsLocalPlayer``
When you are owner of an object, you can check for ``IsOwner`` in any NetworkedBehaviour, similar to how player objects can do ``IsLocalPlayer``

## Object destruction
When a client disconnects. All objects owned by that client will be destroyed. If you don't want that. (Ex. if you want the objects to be dropped), you can remove ownership just before they are destroyed.
When a client disconnects, all objects owned by that client will be destroyed. If you don't want that (Ex. if you want the objects to be dropped), you can remove ownership just before they are destroyed.


Simply remove the ownership in the OnDestroy method on the player object that owns the object and remove ownership there. That will be handled before the owned object is destroyed.
Simply remove the ownership in the OnDestroy method on the player object that owns the object and remove ownership there. That will be handled before the owned object is destroyed.