Skip to main content

Create a Spawn switch

A Spawn switch displays objects registered in VRCObjectPool one at a time.

Prepare the Spawn targets

1. Prepare the switch​

  1. Add a GameObject for the switch to the Hierarchy
  2. Add a Collider for Interact detection
  3. Add the SpawnObject component
  4. In VRC Object Pool on SpawnObject, assign the GameObject containing the VRCObjectPool you created

Inspector configured with SpawnObject

When a player Interacts with the switch, objects in the Pool are displayed in sequence.

Spawn position​

Create a GameObject that represents the spawn position, then assign its Transform to Spawn Point. Both position and rotation are applied.

Scene view showing the Spawn Point position and orientation

Enable Move Item To Hand to move the object to whichever hand is closer to the switch. In this case, Spawn Point is not used.

Test the switch​

  1. Start the world
  2. Interact with the Spawn switch
  3. Confirm that one object from the Pool appears
  4. If Spawn Point or Move Item To Hand is configured, confirm that the object moves to the expected position

See SpawnObject settings for details about each field.

After confirming the behavior, continue to Create a Return trigger.