World Triggers

How to work with the GS_Interaction World Trigger system — configuring sensor types and trigger types to create event-driven world responses without scripting.

World Triggers are a data-driven system for firing game responses when conditions are met. A TriggerSensorComponent defines the condition side — physics overlap, player interact, record check. A WorldTriggerComponent defines the response side — changing stage, toggling an entity, writing a record, logging a message. Each component holds an array of polymorphic type objects, so any combination of conditions and responses can be composed on a single entity without scripting.

For architecture details, component properties, and extending the system in C++, see the Framework API reference.

 

Contents


How World Triggers Work

World Trigger Pattern Graph

Breakdown

Each trigger is split into two container components. Logic lives in type objects held by each component:

PartRole
TriggerSensorComponentHolds andConditions and orConditions arrays of TriggerSensorType objects. When conditions pass, fires WorldTriggerRequestBus::Trigger on the same entity.
WorldTriggerComponentHolds a triggerTypes array of WorldTriggerType objects. On Trigger(), calls Execute() on every type. On Reset(), calls OnReset().

You can add any mix of sensor types and trigger types — for example, a door that requires both a physics overlap AND a record flag (andConditions) before it opens (TriggerType_ToggleEntities), then sets a quest record (TriggerType_SetRecord).

E Indicates extensible classes and methods.

Patterns - Complete list of system patterns used in GS_Play.


Sensor Types

Trigger Sensor component in the O3DE Inspector

Add sensor types to the andConditions or orConditions arrays on a TriggerSensorComponent. The four built-in types cover the most common condition patterns:

Sensor TypeConditionNotes
SensorType_InteractAny unit with targeting interacts with this entity.Requires GS_TargetComponent or GS_InteractTargetComponent on the entity.
SensorType_PlayerInteractThe player-controlled unit specifically interacts with this entity.Extends SensorType_Interact; filters to entities with the "Player" tag.
SensorType_ColliderA physics collider enters the entity’s trigger volume.Automatically activates a PhysicsTriggerComponent — no manual setup needed.
SensorType_RecordA game record reaches a configured value.Connects to RecordKeeper automatically; fires without polling.

Trigger Types

World Trigger component in the O3DE Inspector

Add trigger types to the triggerTypes array on a WorldTriggerComponent. The four built-in types handle the most common response patterns:

Trigger TypeResponseNotes
TriggerType_PrintLogPrints a message to the development log.Development and debugging use.
TriggerType_SetRecordWrites a value to the Record Keeper by name.Useful for setting quest flags, unlock states, or counters.
TriggerType_ToggleEntitiesEnables or disables referenced entities. Seeds initial state at startup via startActive.Works with any entity in the level — doors, pickups, blockers.
TriggerType_ChangeStageTransitions the game to a different stage (level).Queued on next tick; coordinates with Stage Manager automatically.

Reset and Re-Arming

Calling Reset() on WorldTriggerRequestBus calls OnReset() on every trigger type in the component. Each type can reverse its effect or prepare for re-activation:

  • TriggerType_ToggleEntities inverts entity states on both Execute and OnReset, enabling toggle behavior.
  • Switches that cycle on repeat interaction.
  • Area triggers that fire each time a player re-enters.
  • Multi-step sequences where earlier steps re-arm later ones.

ScriptCanvas Usage

WorldTriggerRequestBus exposes both core methods directly to scripts:

A common script pattern is to use a SensorType_Record condition to gate a sequence, then script the reset from a separate event so the trigger only re-arms after additional conditions are met:

You can also bypass the sensor component entirely and call Trigger() directly from any script when you need to fire a world trigger response programmatically — for example, from a dialogue completion callback or an animation event.


Editor Setup Pattern

Most interactive world objects follow this assembly in the editor:

  1. Create an entity for the interactive object (door, switch, collectible, zone border).
  2. Add a TriggerSensorComponent to the entity.
  3. Add the appropriate sensor type(s) to andConditions or orConditions (e.g. SensorType_PlayerInteract for interact, SensorType_Collider for proximity).
  4. Add a WorldTriggerComponent to the same entity.
  5. Add the appropriate trigger type(s) to triggerTypes (e.g. TriggerType_ToggleEntities to open a door, TriggerType_SetRecord to record the event).
  6. Configure each type’s properties in the editor — no scripting needed for these patterns.

For interact-based sensors, also add GS_TargetComponent or GS_InteractTargetComponent so the Targeting system can select this entity.


Quick Reference

NeedBusMethod
Fire a trigger response from scriptWorldTriggerRequestBus (ById)Trigger()
Re-arm a trigger after it has firedWorldTriggerRequestBus (ById)Reset()
Fire sensor evaluation from event-driven typeTriggerSensorRequestBus (ById)DoAction() / DoResetAction()

 

Condition TypeSensor Type
Any unit interactsSensorType_Interact
Player only interactsSensorType_PlayerInteract
Physics overlapSensorType_Collider
Record/flag stateSensorType_Record

 

Response TypeTrigger Type
Log a debug messageTriggerType_PrintLog
Write a game recordTriggerType_SetRecord
Toggle an entity on/offTriggerType_ToggleEntities
Change stage/levelTriggerType_ChangeStage

Glossary

TermMeaning
TriggerSensorComponentContainer component that owns sensor type objects and evaluates them on each event
WorldTriggerComponentContainer component that owns trigger type objects and calls Execute on each Trigger()
TriggerSensorTypeA type object that defines one condition — extend this to create custom sensor logic
WorldTriggerTypeA type object that defines one response — extend this to create custom trigger logic
andConditionsArray on TriggerSensorComponent where all types must pass for the trigger to fire
orConditionsArray on TriggerSensorComponent where any one type passing is sufficient
Re-ArmingCalling Reset() on a WorldTriggerComponent so its types can fire again on the next Trigger()

For full definitions, see the Glossary.


See Also

For the full API, component properties, and C++ extension guide:

For related systems:


Get GS_Interaction

GS_Interaction — Explore this gem on the product page and add it to your project.