Trigger¶
After gameplay components have been added to an object, they still need good timing to work. The Trigger component lets you attach a trigger for gameplay components and specify the conditions.
Note: You can add Trigger to any gameplay component. The following instructions take Rotate as an example.
Triggering rotation¶
-
Choose an object as the trigger in the scene and add the Trigger component by choosing + Feature>Gameplay>Trigger.
-
Set a trigger box in the Properties window by choosing + Trigger. A trigger box can take the shape of a sphere, box, or capsule.
-
Change the position and size of the trigger box by adjusting its center and size.
-
Choose the condition for the trigger.
- Touched by player, triggered when the object is touched by the player
- On Enter, triggered when the player enters the area in which the object is located
- On Exit, triggered when the player exits the area in which the object is located
- Insufficient health, triggered when the player's health drops below a specified threshold
- Quest Complete (Other), triggered when a specific quest attached to another object is complete
-
Dialog Complete (Other), triggered when a specific dialog attached to another object is complete
-
Add the target of the trigger.
-
Choose an object and the triggered effect. Make sure the target object has at least one effect, such as rotation, revolve, or move.
Rotation triggered¶
In some cases, you can start your journey by choosing a target effect and make it triggered by another object in the scene. The following two examples show you how to set up an effect and get it triggered.
Setting rotation triggered by the current object¶
-
Select an object in your scene and add the Rotate component to it.
-
By default, a trigger is attached to the component. If you want to add more triggers, choose + Add trigger on the component panel.
-
Choose a trigger object. By default, the trigger object is Self. Now the gameplay component is triggered by the current object itself.
-
Choose a condition for the trigger. See trigger conditions for more details.
Setting rotation triggered by another object¶
-
Select an object in your scene and add the Rotate component to it.
-
By default, a trigger is attached to the component. If you want to add more triggers, choose + Add trigger on the component panel.
-
Choose Others as the trigger object. When Others is selected, the gameplay component is triggered by another object.
-
Select the object.
-
Choose the condition for the trigger. See trigger conditions for more details.
-
View the trigger object.