Skip to main content

<trigger>

Adds a trigger area to the space that will trigger onEnter and onLeave callbacks when an avatar enters or leaves the area.

Props

PropTypeDescriptionDefault
sizeNumber|ArraySize of the box. Use an array to control width, height, and depth separately.1
positionArrayPosition of the trigger area.[0,0,0]
rotationArrayRotation of the trigger area.[0,0,0]
onEnterFunctionCalled when an avatar enters the area. Provides a TriggerEvent.
onLeaveFunctionCalled when an avatar leaves the area. Provides a TriggerEvent.

Notes

  • Trigger areas are great for automatically making something happen without an avatar having to click something. You can use triggers to create teleporters, open doors or start transitions etc.