# Trigger Event

## 📒<mark style="color:blue;">Use of Trigger Events</mark>

### 1.Adding Trigger Event

1）Select a single layer or a single scene.

2）Click the "Add Event" button on the right side to open the trigger event type options tab.

3）Based on the product gameplay and asset requirements, select the appropriate trigger event.

4）After adding the trigger event, you can add the desired response events below it.

<mark style="color:red;">**Note:**</mark> <mark style="color:red;"></mark><mark style="color:red;">Typically, the object for adding a trigger event depends on where we want players to interact.</mark>&#x20;

For example, if we want a specific effect to occur when players click on an item, we can **select the layer** of that item and add the "click" trigger event with the corresponding response event.  If we want players to be able to click anywhere on the screen, we can directly **select the scene** and add the "click" trigger event with the corresponding response event.

<div align="left"><figure><img src="/files/n7TevD6HtJsVdiRAryks" alt=""><figcaption></figcaption></figure></div>

### 2.Replacing Trigger Event&#x20;

Clicking the icon button allows you to replace an already added trigger event (without changing the response events).

<div align="left"><figure><img src="/files/18LujLmqwKsnB2ly4ALg" alt=""><figcaption></figcaption></figure></div>

### 3.Copying Event

1）Clicking the icon button enables you to copy the corresponding trigger event along with its response events.

<div align="left"><figure><img src="/files/1HpCGComor44zEZ3svDi" alt=""><figcaption></figcaption></figure></div>

2）After copying the event, you can select the layer or scene where you want to paste the event and quickly implement the same event.

<div align="left"><figure><img src="/files/Hkxn1SXJIHUvif0WAIvL" alt=""><figcaption></figcaption></figure></div>

### 4.Deleting Trigger Event&#x20;

Clicking the icon button allows you to delete the corresponding trigger event along with its response events.

<div align="left"><figure><img src="/files/92xWyuUTQkiT3dnPYYyj" alt=""><figcaption></figcaption></figure></div>

### <mark style="color:red;">5.Valid only once</mark>

Under each trigger event, there is an option for **"**&#x56;alid only onc&#x65;**."** By default, this option is unchecked, meaning the event can be triggered multiple times. If checked, the event will only be effective once and cannot be triggered again afterward!\
Please set this according to your creative needs.

**⚠️Note: "Valid only once" and redirect to store events**

* In most cases, <mark style="color:orange;">it's</mark> <mark style="color:orange;"></mark><mark style="color:orange;">**not**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">recommended to select "Valid only once" for any events that trigger a redirect to app store (e.g., persistent download button, end scene redirect events, etc.).</mark> >>> If selected, the player will not be able to redirect to app store again after returning from the store to the playable ad.
* <mark style="color:orange;">The exception is the "Condition" trigger event on the scene.</mark> >>> When "Condition" is used as the trigger event and has a redirect to app store as the response event, the event might be repeatedly triggered, causing multiple redirects to the store. In this case, "Valid only once" should be selected. >>> Additionally, to ensure that players can redirect to the store again after returning from the store to the playable ad, it's recommended to set an extra download button or other form of redirect on the end scene.

<div align="left"><figure><img src="/files/3LHosObeMliLfA3HqvZv" alt=""><figcaption></figcaption></figure></div>

## 📒<mark style="color:blue;">Classification of Trigger Events</mark>

Trigger events include six types: \[Click], \[Swipe], \[Drag], \[Delay], \[Logic], and \[Media playback].

<table data-full-width="false"><thead><tr><th width="213">Image</th><th width="183">Event Properties</th><th width="118">Trigger Event</th><th>Triggering Methods Included</th></tr></thead><tbody><tr><td><img src="/files/xn8SDoeXT1YIPok6MjZN" alt=""></td><td>General events</td><td><strong>Click</strong></td><td><p>Click</p><p>Long press 3s</p><p>Press</p><p>Lift up</p><p>Double click</p></td></tr><tr><td><img src="/files/TtHdG6nOHd8tvP24GJ31" alt=""></td><td>General events</td><td><strong>Swipe</strong></td><td><p>Swipe up</p><p>Swipe down</p><p>Swipe left</p><p>Sipe right</p><p>Swipe arbitrarily</p></td></tr><tr><td><img src="/files/VDJ5L8tnIolJdpXo1Vz8" alt="" data-size="original"></td><td><p>Layer events</p><p>(General layers)</p></td><td><strong>Drag</strong></td><td><p>Drag</p><p>Drag to target position</p><p>Not dragged to target position</p></td></tr><tr><td><img src="/files/QuCtvEcEDXfLOzxHIGEQ" alt=""></td><td><p>Layer events</p><p>(Video/Audio layers)</p></td><td><strong>Media playback</strong></td><td><p>Starting time</p><p>Ending time</p></td></tr><tr><td><img src="/files/zp23USTsrvF6UCDSl0nR" alt=""></td><td>Scene events</td><td><strong>Delay</strong></td><td>Timing trigger</td></tr><tr><td><img src="/files/UNO0mkW8p7LoBhqnXx0N" alt=""></td><td>Scene events(Global Variables)</td><td><strong>Logic</strong></td><td>Condition</td></tr></tbody></table>

### 1.General Event: **Click**

1）"Click" includes: Click, Long press 3s, Press, Lift up, Double click.&#x20;

2）Corresponding triggering moments are:

* **Click:** Triggered when the user presses and then releases the screen.
* **Press:** Triggered as soon as the user presses down on the screen, regardless of whether they lift their finger. <mark style="color:orange;">(It is recommended to use "Press" instead of "Click," as it makes interactions easier to trigger!)</mark>
* **Long press 3s:** Triggered when the user holds down the screen for 3 seconds and then releases.
* **Lift up:** Triggered when the user lifts their finger from the screen, regardless of how long it was pressed.
* **Double click:** Triggered when the user quickly taps the screen twice.

<div align="left"><figure><img src="/files/tSUN9QHLOOg5GRQtH3D7" alt=""><figcaption></figcaption></figure></div>

### 2.General Event: Swipe

1）"Swipe" includes: Swipe up, Swipe down, Swipe left, Sipe right, Swipe arbitrarily.

2）Corresponding triggering moments are:

* **Swipe up:** Triggered when the user swipes upwards on the screen and then releases.
* **Swipe down:** Triggered when the user swipes downwards on the screen and then releases.
* **Swipe left:** Triggered when the user swipes leftwards on the screen and then releases.
* **Swipe right:** Triggered when the user swipes rightwards on the screen and then releases.
* **Swipe arbitrarily:** Triggered when the user swipes in any direction on the screen and then releases.&#x20;

<mark style="color:red;">Note: With the "Swipe" event category, the layers do not follow the movement of the player's finger.</mark>

<div align="left"><figure><img src="/files/BpxkFW8uBYhVCzQ5oFsI" alt=""><figcaption></figcaption></figure></div>

### 3.Layer Event: Drag

1）"Drag" includes: Drag, Drag to target position, Not dragged to target position.

2）Corresponding triggering moments are:

* **Drag:** Triggered when dragging a layer without releasing the touch.
* **Drag to target position:** Drag a layer, and <mark style="color:red;">if you</mark> <mark style="color:red;"></mark><mark style="color:red;">**release it in the target area**</mark><mark style="color:red;">, the event will be triggered</mark>; if you release it outside the target area, the layer will default to return to its original position without triggering the event.
* **Not dragged to target position:** Drag a layer, and <mark style="color:red;">if you</mark> <mark style="color:red;"></mark><mark style="color:red;">**release it outside the target area**</mark><mark style="color:red;">, the event will be triggered</mark>; if you release it in the target area, the layer will default to return to its original position without triggering the event.

3）After using Drag-type events:

* You need to "edit the drag area"**:**  Add designated area - adjust the position and size of the area - select the draggable range (Full Screen/Custom).
* You need to select the "Drag Direction"**:** Options include Any Direction, Horizontal Direction, and Vertical Direction. <mark style="color:red;">(Please Note: Only one drag direction can be set per layer.)</mark>
* You need to select **"Release Reset":**  By default, this is set to "reset," meaning the layer goes back to its original position when released. If you choose "No," the layer will stay in the position where it was released.

Note: The drag-type events is only applicable to regular layers, excluding video and audio layers.

&#x20;👉Related content:   [/pages/9WLWf87yQemaLEMZgGwb#id-3.issues-related-to-drag-type-events](https://doc.playturbo.com/playable-tools-content-editor/content-editor-user-guide/editing-page-module-intro/parameter-setting-area/event-common-parameters/pages/9WLWf87yQemaLEMZgGwb#id-3.issues-related-to-drag-type-events "mention")  [Creation Tips - Event Setting](/playable-tools-content-editor/content-editor-creation-tips-center/common-creation-tips/creation-tips-event-setting.md#real-time-error-feedback-following-dragged-position)

<div align="left"><figure><img src="/files/hzKJfMrjGT6mhwqsTw0e" alt=""><figcaption></figcaption></figure></div>

### 4.Layer Event: Media Playback

1）"Media Playback" includes: Starting time, Ending time.

2）Corresponding triggering moments are:

* **Starting time:** Triggered when the selected video/audio starts playing.
* **Ending time:** Triggered when the selected video/audio finishes playing.&#x20;

Note: The "Media Playback" event is only applicable to video and audio layers.

<div align="left"><figure><img src="/files/Sxvsrk8zQS4Eck1d7tqG" alt=""><figcaption></figcaption></figure></div>

### 5.Scene Event: Timing trigger

1）"Delay"  includes: **Timing trigger**. <mark style="color:orange;">("Timing trigger" can only be added to scenes.)</mark>

2）The corresponding triggering moment is based on the set "Delay time" for timer-triggered events (if the delay time is set to 0s, it means the event will be triggered automatically when entering the scene).&#x20;

<div align="left"><figure><img src="/files/lYCRpVPSYTUf40MKWn7o" alt=""><figcaption></figcaption></figure></div>

<mark style="color:red;">**NOTE：**</mark>

* <mark style="color:red;">**To add multiple timers to a scene:**</mark>**&#x20;Simply add a "Execution Delay" response event** under an existing Timing trigger event. Note that **the execution delay duration is cumulative**; the delay duration of subsequent events will inherit the total duration of the preceding delays (e.g., if a special effect plays 0.5s after entering, and then it waits 1s to redirect to app store, it means the app store will be redirected 1.5s after entering).
* **To add a timer to a layer:** Add the "Execute Delay" response event under the layer event (the logic for adding multiple timers is the same as above).

<div align="left"><figure><img src="/files/HMUHDzsVrK9Hqeq1gQnL" alt=""><figcaption></figcaption></figure></div>

### 6.Scene Event: Condition

1）"Logic" includes: **Condition**.

2）The corresponding triggering moment is when a variable satisfies the specified condition.

3）After adding "Condition," click "Add conditions" in the popup window, then select global variables, mathematical operations, and values in order.

4）It supports checking the option "Valid only once."&#x20;

<mark style="color:red;">Note: You can use this trigger event only if</mark> [Global Variables](/playable-tools-content-editor/content-editor-user-guide/editing-page-module-intro/top-asset-library/global-variables.md) <mark style="color:red;">have been added to the current project</mark> (refer to the feature introduction document for quicker understanding of this trigger event).

<div align="left"><figure><img src="/files/xMqtBDFR5refnBgvDu4j" alt=""><figcaption></figcaption></figure></div>

## <mark style="color:blue;">📒Additional Explanation</mark>

### 1.Layer Event Highlighting

Layers with events will be highlighted. Clicking on the highlighted icon allows you to quickly switch to the event parameter area for that layer.

<div align="left"><figure><img src="/files/qpDHl6bb9NZr1f5fqQ91" alt=""><figcaption></figcaption></figure></div>

### 2.Event Logic with Layer Hierarchy & Size

🌟 **Layer Events > Scene Events**

* If both layer and scene events are present, the area covered by the layer will trigger the layer's event, while areas not covered by the layer will trigger the scene's event.

🌟 **Higher Layer Hierarchy Events > Lower Layer Hierarchy Events**

* For layers with the same size and position: The event of the higher layer will take effect, while the event of the lower layer will not because it's covered by the higher layer.
* For layers with different sizes/positions: Based on the hierarchy logic, the event of the lower layer can still take effect if it’s not covered by the higher layer.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.playturbo.com/playable-tools-content-editor/content-editor-user-guide/editing-page-module-intro/parameter-setting-area/event-common-parameters/trigger-event.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
