SpatialNetworkBehaviour

Class

This component allows you to define custom behaviour for a network object. It must always be accompanied by a SpatialNetworkObject component on the same GameObject or on one of its parents.

Methods

Despawned()

Called before the network object is despawned. Use this method instead of OnDestroy. After this method is called, the network object's state can no longer be modified, and the underlying space object will be marked as disposed.

Spawned()

Called when the network object is spawned. Use this method instead of Start. Accessing and modifying the network object's state is only allowed after this method is called.