When Trigger Enter
Fires when an object enters the range of the trigger.
Introduction
When Trigger Enter is an event in the Trigger group of World Events. It fires when an object enters the range of the trigger. When it fires, the event hands one value to your script: Object, the object that entered the range. Like every event, it does nothing by itself. It waits for the right moment, then runs all the actions connected to it. This event belongs to the Trigger component. Open the Trigger component guide to see everything the component itself can do. Triggers always work as a pair: When Trigger Exited is the counterpart of this event, and together they define a zone with a beginning and an end. For collisions with solid objects instead of open zones, use When Colliding with Objects . The component that powers all of this is documented in the Trigger guide. When Trigger Enter event in the Script Editor Image The When Trigger Enter event in the Script Editor. caption
Parameters
Object the object that entered the trigger area Parameter Description
How to Access
How to Access - Event When Trigger is Entered
How to Use
Select the object, press Propertie (the blue equalizer icon) in the bottom action menu, and scroll to the bottom of the properties panel. Press Add Component and pick the Trigger component; its block stacks below the existing properties with the When Trigger Enter event inside it. Press the + button below the event to add a script, then press Edit on that script to open the script editor and build the actions that should run when the event fires. Press Play and walk into the trigger area, then check that the actions run.
Example
The object changes its color to red when the trigger is entered. When trigger is entered by Object in Event: Set Self Group.Color Change To red when-trigger-entered-example.png Change the color to red when the trigger is entered. caption
Common Uses
Open a door the moment a player steps into a room Start a cutscene, ambush, or sound cue when entering a zone Count how many players have entered an area
Tip
Pair it with When Trigger is Exited so the same area reacts to both arriving and leaving.