Api NetworkAccessor
class

NetworkAccessor

public class NetworkAccessor

Constructors

NetworkAccessor(GameObject o)

Properties

Name Type Description
Active Boolean Is this object networked?
RootGameObject GameObject Get the GameObject that is the root of this network object
IsOwner Boolean Are we the owner of this network object?
OwnerId Guid The Id of the owner of this object
IsCreator Boolean Are we the creator of this network object
CreatorId Guid The Id of the creator of this object
IsProxy Boolean Is this object a network proxy? A network proxy is a network object that is not being simulated on the local pc. This means it's either owned by no-one and is being simulated by the host or owned by another client.
OwnerConnection Connection Try to get the connection that owns this object. This can and will return null if we don't have information for this connection.
Owner Connection Try to get the connection that owns this object. This can and will return null if we don't have information for this connection.
OwnerTransfer OwnerTransfer Who can control ownership of this networked object?
NetworkOrphaned NetworkOrphaned Determines what happens when the owner disconnects.
Flags NetworkFlags Network flags which describe the behavior of this networked object. Can only be changed by the host after the networked object has been spawned.
AlwaysTransmit Boolean Determines whether updates for this networked object are always transmitted to clients. Otherwise, they are only transmitted when the object is determined as visible to each client.
Interpolation Boolean Whether the networked object's transform is interpolated.

Methods

Boolean EnableInterpolation()

Enable interpolation for the networked object's transform. Obsolete: 09/12/2025

Boolean DisableInterpolation()

Disable interpolation for the networked object's transform. Obsolete: 09/12/2025

Boolean ClearInterpolation()

Boolean SetOrphanedMode(NetworkOrphaned action)

Set what happens to this networked object when the owner disconnects.

Boolean SetOwnerTransfer(OwnerTransfer option)

Set who can control ownership of this networked object. Only the current owner can change this.

Void Refresh()

Send a complete refresh snapshot of this networked object to other clients. This is useful if you have made vast changes to components or children.

Void Refresh(GameObject descendent)

Send a refresh for a specific GameObject in the hierarchy of this networked object to other clients. This is useful if you've destroyed or added a new GameObject descendent and don't want to refresh the entire networked object.

Void Refresh(Component component)

Send a refresh for a specific Component in the hierarchy of this networked object to other clients. This is useful if you've destroyed or added a new Component and don't want to refresh the entire object.

Boolean TakeOwnership()

Become the network owner of this object. Note: whether you can take ownership of this object depends on the OwnerTransfer of this networked object.

Boolean AssignOwnership(Connection channel)

Set the owner of this object to the specified Connection. Note: whether you can assign ownership of this object depends on the OwnerTransfer of this networked object.

ArgumentNullException — cannot be null. To clear owner, use DropOwnership instead.
Boolean DropOwnership()

Stop being the owner of this object. Will clear the owner so the object becomes controlled by the server, and owned by no-one. Note: whether you can drop ownership of this object depends on the OwnerTransfer of this networked object.

Boolean Spawn()

Boolean Spawn(Connection owner)

Assembly: Sandbox.Engine Declaring Type: GameObject Full Name: Sandbox.GameObject.NetworkAccessor