Contents

TriggerVolume

An invisible 3D shape that detects when objects enter or exit a given region of space.

Declaration

@MainActor @preconcurrency class TriggerVolume

Overview

A trigger volume is an entity that can participate in collisions because it has a CollisionComponent. You use a trigger volume as a sensor that indicates when another collision-capable entity, like a ModelEntity, enters the region of space occupied by the trigger volume. You can use the generated CollisionEvents between the trigger volume and the other entity to trigger an action, like indicating to the user that a projectile hit its target.

[Image]

The trigger volume itself is very simple. It lacks any physical appearance, and doesn’t participate in physics simulations. This makes it very efficient for tasks that require only collision detection.

Topics

Creating a trigger volume

Detecting collisions

See Also

Collision shapes and groups