menu_bookDocumentation
GameObject.Network Accessor — IsProxy, IsOwner, TakeOwnership, DropOwnership, Refresh, and IGameObjectNetworkEvents
GameObject.Network Accessor — Ownership, Spawning, and Proxy Detection
GameObject.Network is a NetworkAccessor that provides all network-related operations for a GameObject. It always resolves to the network root — if the object is a child of a networked object, Network returns the root's accessor.Key Properties
CSHARP
go.Network.Active // bool — is this object networked?
go.Network.IsOwner // bool — does the local client own this?
go.Network.IsProxy // bool — is this controlled by someone else?
go.Network.IsCreator // bool — did the local client create this?
go.Network.Owner // Connection — the owning connection (may be null)
go.Network.OwnerId // Guid — owner's connection ID
go.Network.CreatorId // Guid — creator's connection ID
go.Network.Flags // NetworkFlags — transform sync behavior
go.Network.AlwaysTransmit // bool — always send updates regardless of visibility
go.Network.Interpolation // bool — whether transform is interpolatedSpawning
CSHARP
// Spawn with local client as owner
go.NetworkSpawn();
// Spawn with a specific owner
go.NetworkSpawn( someConnection );
// Spawn with full options
go.NetworkSpawn( new NetworkSpawnOptions { Owner = someConnection, OrphanedMode = NetworkOrphaned.Host } );Ownership Transfer
CSHARP
// Take ownership (respects OwnerTransfer setting)
go.Network.TakeOwnership();
// Assign to another connection
go.Network.AssignOwnership( someConnection );
// Drop ownership (object becomes host-controlled)
go.Network.DropOwnership();Refresh
After making structural changes (adding/removing components or child GameObjects), call Refresh() to sync the full state to all clients:
CSHARP
go.Network.Refresh(); // Refresh entire object
go.Network.Refresh( childGameObject ); // Refresh a specific descendant
go.Network.Refresh( someComponent ); // Refresh a specific componentIsProxy vs IsOwner
- IsProxy is true when the object is owned by someone else (or unowned and you're not the host).
- IsOwner is true when OwnerId == Connection.Local.Id.
- An unowned object is controlled by the host — IsProxy is false for the host on unowned objects.
IGameObjectNetworkEvents
Implement this interface on a component to receive ownership change callbacks:
CSHARP
public class MyComponent : Component, IGameObjectNetworkEvents
{
public void NetworkOwnerChanged( Connection newOwner, Connection previousOwner ) { }
public void StartControl() { } // We are no longer a proxy
public void StopControl() { } // We became a proxy
}
Was this helpful?