SpatialNetworkObject

Component

Class

This component enables a GameObject to be synchronized across the network. A network object handles synchronizing the transform, rigidbody, and custom variables defined through visual scripting or NetworkVariables within SpatialNetworkBehaviour.

Network objects can be either embedded in a scene or instantiated from a prefab.

To spawn a network object for all clients, use SpatialBridge.spaceContentService.Spawn. Note that GameObject.Instantiate will only create a network object for the local client.

To despawn a network object you can simply Object.Destroy the GameObject, or use SpatialBridge.spaceContentService.DestroySpaceObject. This will despawn the object for all clients.

Inheritance

SpatialSys.UnitySDK.SpatialComponentBase
SpatialNetworkObject

Properties

behaviours
documentationURL
hasControl
isMine
nestedObjects
networkPrefabGuid

Unique ID for the prefab that this NetworkObject is attached to. This is used to know which prefab to instantiate on other clients when this object is spawned. This is only assigned to the root NetworkObject in a prefab.

objectFlags
objectID
ownerActorNumber
parentObject
prettyName
rootObject
sceneObjectGuid

Unique ID for NetworkObjects that are embedded in a scene. Guaranteed to be unique within the scene.

spaceObject
syncFlags
tooltip