s&box multiplayer is built around a host/client model backed byDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/facepunch/sbox-public/llms.txt
Use this file to discover all available pages before exploring further.
NetworkObject. This page explains how that model works, how objects get networked, who controls what, and how you configure ownership behavior on your GameObject.
How the host/client model works
Every s&box session has exactly one host. The host is authoritative: it owns the scene, spawns objects, and resolves conflicts. All other participants are clients that receive state from the host. You can check which role you are running as at any time:Networking.IsHost returns true even when there is no active multiplayer session — a standalone local game is always its own host. Networking.IsActive returns true only when a real networked session exists.
The host processes all incoming client RPCs, owns unowned objects, and is the
only party that can assign ownership to other connections.
NetworkObject and the three network modes
EveryGameObject has a Network accessor that controls how it participates in multiplayer. The NetworkMode enum determines whether and how the object is synchronized:
| Mode | Description |
|---|---|
NetworkMode.Never | The object is never networked. Only exists locally. |
NetworkMode.Object | Networked as an independent object with an owner. Supports [Sync] properties and RPCs. |
NetworkMode.Snapshot | Networked as part of the scene snapshot. The host controls all state. |
NetworkMode.Object. Use NetworkMode.Snapshot for scene-level state that only the host should write.
Ownership
EveryNetworkObject in Object mode has an owner — the Connection that is allowed to write synchronized state and drive the object’s transform. When there is no owner, the host automatically acts as one.
The ownership model exposes three properties you can read from any component:
IsProxy to skip local simulation for objects you do not own:
Spawning a networked object
To spawn aGameObject on the network, call GameObject.NetworkSpawn() from the host, passing the Connection that should own it:
NetworkSpawn is called, the engine sends a create message to all clients. Each client reconstructs the object from serialized JSON, applies the initial transform and synced properties, then calls OnNetworkSpawn on any component that implements Component.INetworkSpawn.
Owner transfer
OwnerTransfer controls who is allowed to change ownership at runtime:
| Value | Behaviour |
|---|---|
OwnerTransfer.Takeover | Any client can claim ownership at any time. |
OwnerTransfer.Fixed | Only the host can change the owner. |
OwnerTransfer.Request | Clients send a request to the host, who approves it. |
What happens when an owner disconnects
When the owning client disconnects, theNetworkOrphaned setting on the object determines what happens next:
| Value | Behaviour |
|---|---|
NetworkOrphaned.Destroy | The object is destroyed for everyone. (default) |
NetworkOrphaned.Host | The host takes over as the new owner. |
NetworkOrphaned.Random | The host randomly picks a connected client as the new owner. |
NetworkOrphaned.ClearOwner | Ownership is cleared — the object becomes unowned. |
NetworkFlags: controlling transform sync
You can opt individual transform axes out of automatic synchronization usingNetworkFlags:
Only the host can change
NetworkFlags after an object has already been
spawned. Clients that try to do so will have their changes ignored.Lifecycle events
Implement the following interfaces on your components to react to network events:IGameObjectNetworkEvents callbacks:
Next steps
Sync vars
Sync component properties automatically using
[Sync] and SyncFlags.RPCs
Call methods across the network with
Rpc.Broadcast, Rpc.Host, and Rpc.Owner.