Triggers are components attached to game objects that listen to events that happen on the scene and react by executing a sequence of instructions.
In the image above, the Trigger is listening for the Space keyboard key to be pressed down. As soon as that happens, it calls the instructions list from below, which prints the message "Space key pressed!"
Creating a Trigger¶
Right click on the Hierarchy panel and select Game Creator → Interaction → Trigger. A game object named 'Trigger' will appear in the scene with a component of the same name.
Alternatively you can also add the Trigger component to any game object clicking on the Inspector's Add Component button and searching for Trigger.
To delete a Trigger component, simply click on the component's little cog button and select "Remove Component" from the dropdown menu.
Changing the Event¶
Triggers listen to very specific events, chosen by the user. To change the type of Event a Trigger listens, click on the event name and a dropdown menu will appear. Navigate it using the mouse or searching for a specific event in the seach box field.
The Instructions list that appear below work exactly the same was the Actions component. For more information about this component, visit the Actions page.