When Trigger Exited
Fires when an object leaves the range of the trigger, including when it is teleported away.
Introduction
When Trigger Exited is an event in the Trigger group of World Events. It fires when an object leaves the range of the trigger, and it also fires when the object is teleported away. When it fires, the event hands one value to your script: Object, the object that left 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. Every exit completes an entry: this event closes the zone opened by When Trigger Entered , which makes the pair perfect for enter/leave rooms, start/stop races, and safe-zone boundaries. Solid contact uses When Colliding with Objects instead, and the Trigger guide explains sizing and layer options. When Trigger Exited event in the Script Editor Image The When Trigger Exited event in the Script Editor. caption
Parameters
Object the object that left the trigger area Parameter Description
How to Access
How to Access - Event When Trigger is Exited
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 Exited 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 out of the trigger area, then check that the actions run.
Example
The object changes its color to green when the trigger is exited. When trigger is exited by Object in Event: Set Self Group.Color Change To green when-trigger-exited-example.png Change the color to green when the trigger is exited. caption
Common Uses
Close a door that opened on entry once the player has left Stop music or effects that started when entering the zone Mark a checkpoint as done after the player moves on
Tip
Teleporting counts as leaving: an object moved away with a teleport command still fires this event.