Trigger Sensors
Categories:
TriggerSensorComponent is the condition container of the World Trigger system. It owns arrays of TriggerSensorType objects that define evaluation logic — collisions, interactions, record checks. When conditions pass, it fires WorldTriggerRequestBus::Trigger on the same entity.
For usage guides and setup examples, see The Basics: GS_Interaction.
Container Component
TriggerSensorComponent

Owns and evaluates all sensor type objects. Not subclassed — extended by adding TriggerSensorType objects to its arrays.
Bus: TriggerSensorRequestBus (ById, Single)
| Field | Type | Description |
|---|---|---|
andConditions | vector<TriggerSensorType*> | All types must pass for the trigger to fire. |
orConditions | vector<TriggerSensorType*> | Any type passing is sufficient to fire. |
| Method | Returns | Description |
|---|---|---|
DoAction | void | Evaluates all conditions. On pass, fires WorldTriggerRequestBus::Trigger and TriggerSensorNotificationBus::OnTriggered. |
DoResetAction | void | Evaluates reset conditions and fires reset if they pass. |
On Activate, automatically activates a PhysicsTriggerComponent on the entity if any sensor type returns true from NeedsPhysicsTrigger().
Base Type Class
TriggerSensorType
Abstract base for all sensor evaluation logic. Not a component — reflected manually in GS_InteractionSystemComponent::Reflect(). Subclass this to add new condition types.
| Virtual | Returns | Description |
|---|---|---|
Activate(entityId) | void | Called when the owning component activates. Connect to buses here. |
Deactivate() | void | Called when the owning component deactivates. Disconnect from buses here. |
EvaluateAction() | bool | Returns true if the condition is currently satisfied. |
EvaluateResetAction() | bool | Returns true if the reset condition is satisfied. Returns true by default. |
NeedsPhysicsTrigger() | bool | Return true to signal that a PhysicsTriggerComponent should be activated. Returns false by default. |
OnTriggerEnter(entity) | void | Called by the physics trigger when an entity enters the volume. |
OnTriggerExit(entity) | void | Called by the physics trigger when an entity exits the volume. |
Stores m_ownerEntityId for calling back to TriggerSensorRequestBus::DoAction() or DoResetAction() from event-driven types.
Built-in Sensor Types
SensorType_Collider
Physics overlap sensor. Returns NeedsPhysicsTrigger() = true, causing the owning component to activate a PhysicsTriggerComponent.
OnTriggerEnterstores the entering entity.OnTriggerExitclears the stored entity.EvaluateAction()returnstruewhile a valid entity is present.EvaluateResetAction()returnstruewhen no entity is present.
SensorType_Record
Fires when a named save record changes to a configured value. Extends RecordKeeperNotificationBus — connects on Activate and fires DoAction automatically when the matching record changes.
EvaluateAction()callsGetRecordand compares againstrecordValue.
→ Record Sensor Type Reference
| Field | Description |
|---|---|
recordName | Name of the record to watch. |
recordValue | Value the record must reach to fire. |
SensorType_Interact
Fires when any unit interacts with this entity via the targeting system. Extends InteractTriggerSensorRequestBus.
- On interact: stores
lastCallerand callsDoAction. EvaluateAction()returnstruewhilelastCalleris a valid entity.
SensorType_PlayerInteract
Player-only variant of SensorType_Interact. Extends SensorType_Interact and adds a tag check — lastCaller must have the "Player" tag for the condition to pass.
Extension Guide
To create a custom sensor type:
- Create a class extending
TriggerSensorType. - Override
EvaluateAction()to define when your condition is satisfied. - Override
Activate(entityId)/Deactivate()to connect and disconnect from any buses. - For event-driven evaluation, listen on a bus and call
TriggerSensorRequestBus::DoAction(m_ownerEntityId)when the event fires — the component will run the full evaluation pipeline. - Return
truefromNeedsPhysicsTrigger()if your type needs a physics volume. - Reflect the class in
GS_InteractionSystemComponent::Reflect()— types are not components and are not registered viaCreateDescriptor().
See Also
Get GS_Interaction
GS_Interaction — Explore this gem on the product page and add it to your project.