menu_bookDocumentation
NetworkOrphaned: Controlling What Happens to a Networked Object When Its Owner Disconnects
NetworkOrphaned: What Happens When an Owner Disconnects
When a networked GameObject's owner disconnects, the NetworkOrphaned enum controls what happens to the object.
Options
| Value | Behavior |
|---|---|
| Destroy | The GameObject is destroyed. |
| Host | Ownership is transferred to the host. |
| Random | The host randomly assigns ownership to another connected client. |
| ClearOwner | The owner is cleared (object becomes unowned). |
How It Works
- Only the host can execute the ownership reassignment for Random and Host modes. Non-host clients temporarily clear the owner until the host broadcasts the new assignment.
- For ClearOwner, non-host clients immediately clear the owner locally; the host broadcasts the change.
- The NetworkOrphaned action is stored on GameObject.Network.NetworkOrphaned.
Unowned Objects
An unowned networked object (Owner == Guid.Empty) is controlled by the host. The host acts as the de-facto owner for permission checks.
Was this helpful?