Description
The NetworkMode.Object
field is a member of the NetworkMode
enumeration in the Sandbox API. It specifies that a GameObject
should be networked as its own distinct network object. This mode allows the object to have an owner and enables the synchronization of its properties using the SyncAttribute
.
Usage
Use NetworkMode.Object
when you want a GameObject
to be independently networked, allowing it to maintain its own state across the network. This is useful for objects that require individual ownership and property synchronization.
Example
// Example of setting a GameObject's network mode to Object
GameObject myObject = new GameObject();
myObject.NetworkMode = NetworkMode.Object;
// This will allow myObject to have an owner and synchronized properties
// across the network using the SyncAttribute.