Skip to main content

Create a Return trigger

When a visible object enters a Return trigger, the Pickup is dropped and the object is hidden.

Setup​

  1. Add a GameObject for the Return trigger to the Hierarchy
  2. Add the ReturnObject component
  3. Add a Collider and enable Is Trigger
  4. In Pools on ReturnObject, register the GameObject containing the VRCObjectPool that manages the objects to hide
  5. Set Layer to the layer number of the Return target GameObject

Inspector configured with ReturnObject and a Collider

The default Layer is 13, which is VRChat's Pickup layer.

Use a dedicated layer

If a Pickup unrelated to Object Spawn System uses the same layer, entering the Return trigger may force that Pickup to Drop and make it impossible to retrieve. Use a layer dedicated to Return targets to prevent unintended reactions.

See Prepare a Pickup for spawning for instructions on creating a dedicated layer.

Scene view showing the Collider area of a Return trigger

Register multiple Pools​

You can register either of the following in Pools.

  • A GameObject containing a VRCObjectPool component
  • A parent GameObject containing multiple child VRCObjectPool components

If you use separate VRCObjectPool components for food, drinks, and other categories, place them under an empty parent GameObject.

ObjectSpawnPools
├─ FoodPool
├─ DrinkPool
└─ DessertPool

In this example, registering ObjectSpawnPools in Pools makes every VRCObjectPool under it a Return target.

Multiple VRCObjectPool components registered in ReturnObject Pools

Share settings with another ReturnObject​

To use the same Pool settings for multiple Return triggers, assign a configured ReturnObject to Reference.

This allows multiple Return triggers to share the same Pool settings.

Return target

In the standard version of Object Spawn System, the GameObject entering the trigger must itself be registered in VRCObjectPool.

Test the trigger​

  1. Display an object with a Spawn switch
  2. Place the displayed object in the Return trigger
  3. Confirm that the Pickup is dropped and the object becomes hidden

See ReturnObject settings for details about each field.

If needed, continue to Create a Reset switch.