Triggers & Targets
This page provides an overview of triggers and targets in map building. It explains how triggers can activate various entities, known as targets, and details common types and properties of both triggers and targets. Additionally, it includes a step-by-step guide on adding a trigger and target to a map.
Many different types of entities can be activated by a trigger. For example, you could trigger a light to turn off when the player enters a room or you could trigger a mover to start moving when a player activates a button.
In these examples, the light and the mover are called targets.
Common Target Types
There are many additional target types located under New Entity → Target. Listed below are some of the more common target entities that can be used to create intricate logic and gameplay.
| Target Name | Description |
|---|---|
| change_color | Used to change the color of a light or dynamic model. An example is used in the Add a Door to a Map section of the Interacts page. |
| hide | Used to hide an entity. |
| relay | Useful for adding a delay into the trigger/target logic. |
| show | Used to show a hidden entity. |
| spawn | Spawns an AI. |
| teleport | Teleports an entity to a given location. |
Common Trigger Properties
These common trigger properties can help you define the trigger's behavior:
| Trigger Property | Description |
|---|---|
| Wait | The number of seconds that the trigger will wait before activating again. This property is useful on triggers that can be activated multiple times. This keeps the trigger from activating a target before the target is ready again. |
| Delay | The number of seconds the trigger will delay activating the target. This can be useful for sequencing events. |
| Trigger Once | Enabled for triggers that will activate only once. Disabled for triggers that can be activated many times, like a teleporter. |
Add a Trigger and Target to a Map
The most basic trigger will activate when a player touches the trigger volume.
-
In your map, in World Editor, right-click to open the context menu.
-
Go to New entity → Trigger → Trigger.
-
Resize and place the trigger in the desired area of your map.
-
Add a target entity to the map.
- For more information about placing entities, see: Placing Entities.
-
Deselect everything.
-
Select the trigger and select the target. Then connect the two using Ctrl+K.
infoDoing this will add the target to the Targets List property on the trigger entity. Any number of targets can be added to a trigger.