Resetting network objects when out of bounds

You can configure network objects to reset if they leave a defined region. For example, you could configure tennis balls to return to a rack if they move outside the bounds of a tennis court.

You use a game object to define the boundary within which specified network objects must remain. Specifically, it is the bounds of the object's colliderarrow-up-right that defines the permissible region. We recommend that you use a Box Collider component so that you see an accurate representation of the boundary in the Unity editor.

circle-exclamation

On another game object, add a Network Object Respawn Manager script component, and then add references to both boundary game object and the network objects that you want to restrict.

circle-exclamation

The following diagram shows an example of how to arrange the components for a single network object in Unity, and the required references.

Example use of the NetworkObjectRespawnManager

Last updated