Skip to content

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.

Setting rotation triggered by the current object

  1. Select an object in your scene and add the Rotate component to it.

    add-rotate

  2. By default, a trigger is attached to the component. If you want to add more triggers, choose + Add trigger on the component panel.

    add-trigger

  3. Choose a trigger object. By default, the trigger object is Self. Now the gameplay component is triggered by the current object itself.

    trigger-self

  4. Choose the condition for the trigger.

    • On start, triggered when you switch to Play mode.
    • 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.

    trigger-condition

Setting rotation triggered by another object

  1. Select an object in your scene and add the Rotate component to it.

    add-rotate

  2. By default, a trigger is attached to the component. If you want to add more triggers, choose + Add trigger on the component panel.

    add-trigger

  3. Choose Others as the trigger object. When Others is selected, the gameplay component is triggered by another object.

    trigger-others

  4. Select the object.

  5. Choose the condition for the trigger.

    • On start, triggered when you switch to Play mode.
    • 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.

    others-condition

  6. View the trigger object.