> For the complete documentation index, see [llms.txt](https://doc.playturbo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.playturbo.com/playable-tools-content-editor/content-editor-creation-tips-center/common-creation-tips/creation-tips-event-setting.md).

# Creation Tips - Event Setting

\#Content Editor

## 📒<mark style="color:blue;">Global Variable Calculation for Interactions - Different Layers</mark>

### <mark style="background-color:orange;">1.Application Scenarios</mark>

**Achieving the effect of "multiple interactions, where each click/drag on different layers triggers the same or different feedback."**  Here are some examples:

* Example 1: After clicking and finding 5 target items, redirect to the app store.&#x20;
* Example 2: After successfully dragging all 3 puzzle pieces to the correct positions, a "Next Level" button appears as an indication.
* Example 3: For each group of elements eliminated, the progress bar advances, and after completing 3 groups of eliminations,  redirect to the next scene.
* ... ...

### <mark style="background-color:orange;">2.Case Preview</mark>

We will use the template "Find Items" as an example  to create a simplified version and focus on explaining how to achieve this type of gameplay using Global Variables.

[Simplified Version](http://tinyurl.com/4jhuxj4s) Gameplay Process:

* Click on the screen to find cats.
* Each time a cat is found, play a star particle feedback and increment the count of found cats.
* After finding three cats in total, redirect to the end page.

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2F1xC47lCJesOzNeDcKjFq%2Fimage.png?alt=media&amp;token=ee454fac-8c5e-4e89-a2b1-e19811f55938" alt=""><figcaption></figcaption></figure></div>

### <mark style="background-color:orange;">3.Step-by-Step Explanation</mark>

Creating this type of gameplay requires three steps: adding a numeric variable、assigning the value to each element、and adding Conditions to calculate interaction counts.

#### <mark style="color:red;">**Step 1:  Add Global Variables**</mark>

* Click on \[Global Variables] - \[Add variables]
* Enter the variable name (such as click times)
* Select variable type as \[Value]
* Set the initial value to 0（At the initial screen, the player has not yet clicked.）
* Save

<figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2FM0QWiPj6RyBCvERVUAh3%2Fimage.png?alt=media&amp;token=ea73973c-111f-411e-9a9f-484b5bcd907d" alt=""><figcaption></figcaption></figure>

#### <mark style="color:red;">**Step 2: Assign the value**</mark>

* Select the layer \[cat1] - \[Add Event] - \[Press]
* <mark style="color:red;">\[Add response event] - \[Assign the value]: clicktimes+1</mark> (i.e. press a cat and the number of clicks will increase by 1)

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2Fja8pHh16GbqTpt9ddI7I%2Fimage.png?alt=media&amp;token=d4c5ccb0-f21a-4ad4-b31f-1c51cc379dc5" alt=""><figcaption></figcaption></figure></div>

* Continue to add response events - \[Show layer] cat1 -  \[Hide layer] star1
* After adding, we click the \[Copy] button to copy the entire event

<figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2F0eJ8OfttEPodkheqcJbH%2Fimage.png?alt=media&amp;token=f85dae3b-5568-417f-9a08-eafc51000cf7" alt=""><figcaption></figcaption></figure>

* Then paste them into layers \[cat2] and \[cat3] in sequence, and change the corresponding effective layers to cat2/star2, cat3/star3

<figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2FIkLc6jEu5PBhR3TXsFss%2Fimage.png?alt=media&amp;token=a5dadb44-38ee-4a8a-940c-042ad7dba5b5" alt=""><figcaption></figcaption></figure>

#### <mark style="color:red;">**Step 3: Add Condition**</mark>

* Click on \[Event] in the **current scene** - \[Add Event] - Select \[Condition] - \[+Condition]
* <mark style="color:red;">\[Add condition 1] : clicktimes=Value 1, and check \[Valid only once]</mark>（When the interaction count equals 1.）

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2FjioUUleIhW8fMtNmlJpm%2Fimage.png?alt=media&amp;token=15e46655-0126-4613-a252-046b1f5be886" alt="" width="563"><figcaption></figcaption></figure></div>

* \[Add response event] - \[Show layer] text\_1 - \[Hide layer] text\_0

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2FUORn6e7zwIQ4V8KUZbOZ%2Fimage.png?alt=media&amp;token=669b48fd-c84b-4953-8cea-f44ea6e7ef34" alt=""><figcaption></figcaption></figure></div>

* Similarly, continue to add two conditions: **clicktimes=2**（When the interaction count equals 2.）、**clicktimes=3**（When the interaction count equals 3.）
* And sequentially add response events: Show text\_2\&Hide Text\_1、Show text\_3\&Hide Text\_2
* <mark style="color:red;">**Note:**</mark> Because we want to achieve "redirect the end page after finding three cats", we need to add an additional response event - Redirect to the next scene in Condition 3 (i.e. when the number of clicks=3) (execution delay of 0.5 seconds is the reserved particle playback time)

<figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2FW9BrqaP7EqCkMDXoXgKJ%2Fimage.png?alt=media&amp;token=ca51d88a-e6b9-426e-b871-bfdc7abbc662" alt=""><figcaption></figcaption></figure>

With these steps, the event setup is complete. When you encounter a need to **"calculate the interaction count on different layers to trigger specific feedback,"** you can try applying this logic and method in your own projects!

## 📒<mark style="color:blue;">Global Variable Calculation for Interactions - Same Layers</mark>

### <mark style="background-color:orange;">1.Application Scenarios</mark>

**Achieving the effect of "multiple interactions, where each click/drag on the same layer triggers the same or different feedback."** Here are some examples:

* Example 1: On the first click on the wheel, it stops at position A. On the second click, it continues from position A and stops at position B.
* Example 2: Clicking the "Generate" button results in the appearance of a new character with each click.
* Example 3: Clicking an item produces the same particle effect or other feedback with each click.
* ... ...

### <mark style="background-color:orange;">2.Case Preview</mark>

&#x20;Gameplay Process of [This Case](https://tinyurl.com/26cnjbb3):

* The initial state has the wheel stopped at the red position.
* On the player's first press, the wheel rotates to the purple position and stops.
* On the player's second press, the wheel continues rotating from the purple position and stops at the cyan position.

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2FZW8CFmF4AfC1eE1HzCx7%2Fimage.png?alt=media&amp;token=55a50c85-0a65-415c-8e08-baa63958dd40" alt=""><figcaption></figcaption></figure></div>

### <mark style="background-color:orange;">3.Step-by-Step Explanation</mark>

Creating this type of gameplay requires 2 steps: aadding a numeric variable、adding Conditions and assigning the value to the layer events.

#### <mark style="color:red;">**Step 1:  Add Global Variables**</mark>

* Click on \[Global Variables] - \[Add variables]
* Enter the variable name (e.g., tap).
* Select variable type as \[Value]
* Set the initial value to 0（At the initial screen, the player has not yet clicked.）
* Save

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2F4GTOkWYObulgC9Bb3l2A%2Fimage.png?alt=media&amp;token=c5a7b2f5-71ea-406e-8ac0-77e109ba4c91" alt=""><figcaption></figcaption></figure></div>

#### <mark style="color:red;">Step 2: Add Conditions and Assign the value</mark>

* Select the layer that will be clicked - "Add Event" - "Press."
* <mark style="color:red;">Add Condition 1: tap = 0</mark> (indicating the interaction count is 0).
* <mark style="color:red;">Add response event "Assign the value": assign the value "tap+1"</mark> (incrementing the interaction count to 1).
* Add other response events: play the rotation animation 1 of the wheel, play feedback sound effects once, etc.

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2Fh2lZvRg9qGnPRSL5Pa8l%2Fimage.png?alt=media&amp;token=229df9d0-5e57-4279-9f31-61f5ddf145f1" alt=""><figcaption></figcaption></figure></div>

* <mark style="color:red;">Add Condition 2: tap = 1</mark> (indicating the interaction count is 1).
* <mark style="color:red;">Add response event "Assign the value": assign the value "tap+1"</mark> (incrementing the interaction count to 2).
* Add other response events：play the rotation animation 2 of the wheel, play feedback sound effects once, etc.
* **Similarly, if you want to handle the player's third click, fourth click, and so on, you can set tap = 2, tap = 3, and so on.**

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2FDSoGaTj2MouU5orXdCqX%2Fimage.png?alt=media&amp;token=58eb1ca3-f9af-40c4-936c-38a605a64ba0" alt=""><figcaption></figcaption></figure></div>

*The parameters for the rotation animation of the wheel are as follows*

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2FWDmQe0WABpEpWL7zq3z8%2Fimage.png?alt=media&amp;token=a53edc9e-13d3-438f-9849-1496794a7862" alt=""><figcaption></figcaption></figure></div>

With these steps, the event setup is complete. When you encounter a need to **"calculate the interaction count on same layers to trigger specific feedback,"** you can try applying this logic and method in your own projects!

## <mark style="color:blue;">📒Using Global Variables to Control Interaction Toggles</mark>

### <mark style="background-color:orange;">1.Application Scenarios</mark>

**To achieve an effect where player interaction is disabled during feedback playback and only re-enabled afterward**, you can use a Global Variable to control interaction. Here are some examples:

* Example 1: In a match-3 gameplay, after a successful elimination, particle effects and sound feedback are triggered. The player shouldn't be able to click other blocks until the feedback is complete.
* Example 2: When clicking a blind box, an item image pops up. Other blind boxes should not be clickable until the image disappears.
* ... ...

### <mark style="background-color:orange;">2.Case Preview</mark>

Take the [*Match 3 Dress Up*](https://playable-portal.mintegral.com/#/mindwork-view?url=https%3A%2F%2Fmmp-cdn.rayjump.com%2Fmindworks-interactive-ads.html%3Furl%3Dhttps%253A%252F%252Fmmp-cdn.rayjump.com%252Fgm%252Ft%252F20001751%252F13755%252Fpv%252F24%252F12%252F09%252F6756911e0db74%252Fproject.html%253Floading%253D1%2526preview%253Dtrue%2526lang%253Dzh-cn%2526preview%253Dtrue%2526itavideo%253D2%2526vconsole%253D0%2526mw_test%253D0%2526loading%253D1%26mw_test%3D0%26is_browser_tips%3D1%26ptloading%3D1%26track_data%3D%257B%2522pid%2522%253A20001751%252C%2522uid%2522%253A142552%252C%2522skin_id%2522%253A13755%252C%2522sct%2522%253A%2522pt_template_index%2522%252C%2522env%2522%253A%2522p%2522%252C%2522cc%2522%253A%2522SG%2522%257D\&orientation=3\&name=\&language=en,zh-cn) as an example:  During the elimination process, other blocks can't be clicked until particles and sounds finish playing.

### <mark style="background-color:orange;">3.Step-by-Step Explanation</mark>

To implement this, follow two main steps: Add a boolean Global Variable → Add Conditions and Assign the Value in Layer Events

#### <mark style="color:red;">**Step 1:  Add Global Variables**</mark>

* Click on \[Global Variables] - \[Add variables]
* Enter the variable name (e.g., eliminate).
* Select variable type as \[Boolean]
* Set the initial value to false

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2FEj5A6EPhZpwQvvlRBeC0%2Fimage.png?alt=media&amp;token=00b0d0a3-59ec-42ee-a28d-59cb41ef1b58" alt=""><figcaption></figcaption></figure></div>

#### <mark style="color:red;">Step 2: Add Conditions and Assign the value</mark>

* Take one of the blocks as an example. Select the corresponding layer, and under all existing click event Conditions, add a new Condition: "eliminate = false".
* Repeat the same setup for all other blocks.

<figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2F6IpXymmsGUHzm2pGPqm8%2Fimage.png?alt=media&amp;token=49c36f24-25cf-4b0b-92e8-bb28a610c6f3" alt=""><figcaption></figcaption></figure>

* Then, go to the scene-level events. Under the Conditions that handle feedback playback, set up the following response events:
  * Assign the value "eliminate = true"
  * After a delay of 0.5s (which equals the duration of the feedback), assign the value "eliminate = false"
* Repeat similar operations for other relevant Conditions as needed.

\*To put it simply: <mark style="color:orange;">when "eliminate = false", the click events are active. Once an elimination is triggered and feedback plays, setting "eliminate = true" disables further clicks. After a 0.5s delay, re-assigning "eliminate = false" re-enables the click events.</mark> This way, a Global Variable is used to toggle interaction on and off across the project.

👉 For the full tutorial of this case, please refer to: [\<Match 3 Dress Up>Blank Canvas Tutorial](/playturbo-case-study/playable-content-editor/elimination-and-match-gameplay-cases/less-than-match-3-dress-up-greater-than-blank-canvas-tutorial.md)  [\<Match 3 Dress Up>Blank Canvas Tutorial](/playturbo-case-study/playable-content-editor/elimination-and-match-gameplay-cases/less-than-match-3-dress-up-greater-than-blank-canvas-tutorial.md#lnpxj-1)

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2FpTnNYILuQPydyZJFnWye%2Fimage.png?alt=media&amp;token=27fee3b6-9bb9-4d66-96bb-d0a43cac3364" alt=""><figcaption></figcaption></figure></div>

🌟**Case Extension**:  If you're working on the blind box click gameplay mentioned in Example 2, the logic becomes even simpler.

* Similarly, add a Global Variable of Boolean type, such as "click", and set its initial value to false.
* Under all blind box click events, add a Condition: "click = false"
* Then, in the Condition of each click event, simply add: Assign the value "click = true"/ Add a delay of 0.5s / Assign the value "click = false"

That’s all you need to achieve the desired result.

## 📒<mark style="color:blue;">Countdown Timer Setup</mark>

### <mark style="background-color:orange;">1.Application Scenarios</mark>

**The initial screen includes a countdown timer.**&#x20;

* **When the player has no action or fails to achieve a specific goal within the set time, trigger the countdown and proceed to Ending A.**&#x20;
* **When the player successfully interacts or achieves the specific goal within the set time, cancel the countdown and proceed to Ending B.**

### <mark style="background-color:orange;">2.Case Preview</mark>

&#x20;Gameplay Process of [This Case](https://tinyurl.com/8de4wcw2):

* Upon entering the trial, displaying core gameplay and the countdown timer.&#x20;
  * If the player completes the drawing within 10 seconds, redirect to the victory page.&#x20;
  * If the player fails to complete the drawing within 10 seconds, redirect to the product information page.

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2FMoPrqA6FqS5twbESeu6p%2Fimage.png?alt=media&amp;token=0e325603-4022-4df3-9790-2108e61f0d82" alt=""><figcaption></figcaption></figure></div>

### <mark style="background-color:orange;">3.Step-by-Step Explanation</mark>

To set up a complete countdown timer, follow these 2 steps: triggering the countdown and canceling the countdown.

#### <mark style="color:red;">Step 1: Trigger the Countdown</mark>

1）After adding the countdown asset, set the countdown sequence as "Playback Interval: 1000ms" and "Automatically Play Once on Entry."

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2FygY0zRxkGCtohVgcQy2H%2Fimage.png?alt=media&amp;token=c11bc8d2-5677-4ab5-8cf5-ab2312a213fd" alt=""><figcaption></figcaption></figure></div>

2）In the core gameplay scene, Add Event - "Timing trigger."

3）Set the execution delay of N seconds to trigger the failure result (e.g., redirect to Scene 3 after 10 seconds).

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2FkfG4cP3mrrYKX6Ns5PY2%2Fimage.png?alt=media&amp;token=5638d53e-28fa-48c1-b16f-ae8b31ac4c4a" alt=""><figcaption></figcaption></figure></div>

#### <mark style="color:red;">Step 2: Cancel the Countdown</mark>&#x20;

**In the event for successful interaction, add response event "Cancel execution delay".**&#x20;

Select the timer ID set in the previous step (e.g., after completing the drawing, redirect to Scene 2 and cancel the timer "timer\_1").

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2FWQTxuvdJaHDugAeGYHuQ%2Fimage.png?alt=media&amp;token=130e31d7-970d-4876-b862-cefca977e81e" alt=""><figcaption></figcaption></figure></div>

Tip: There are multiple countdown presets available in "Presets Library" for your convenience! [Presets Library](/playable-tools-content-editor/content-editor-user-guide/editing-page-module-intro/top-asset-library/presets-library.md)

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2FAPvFUCCv4Ng4eWWpT8sy%2Fimage.png?alt=media&amp;token=2d2ae74f-bb74-4752-a4b7-024ca203d67a" alt="" width="398"><figcaption></figcaption></figure></div>

## 📒<mark style="color:blue;">Real-Time Error Feedback Following Dragged Position</mark>

### 1. [Case Preview](https://playable-portal.mintegral.com/common-viewer/mindwork-view.html?url=https%3A%2F%2Fmmp-cdn.rayjump.com%2Fmindworks-interactive-ads.html%3Furl%3Dhttps%253A%252F%252Fmmp-cdn.rayjump.com%252Fps%252Fpreview%252F24%252F09%252F30%252F66fa7376a40e8%252Findex.html%253Floading%253D1%2526preview%253Dtrue%2526lang%253Den%2526preview%253Dtrue%2526itavideo%253D2%2526vconsole%253D0%2526mw_test%253D0%2526loading%253D1%26mw_test%3D0%26is_browser_tips%3D1%26ptloading%3D1%26track_data%3D%257B%2522pid%2522%253A3116454%252C%2522uid%2522%253A8709%252C%2522sct%2522%253A%2522pt_project_ps%2522%252C%2522env%2522%253A%2522p%2522%252C%2522cc%2522%253A%2522CN%2522%257D\&orientation=3\&name=\&language=en)

### 2. Step-by-Step Explanation

* In the Asset Library - Particle, add any particle effect. Only one particle effect is needed.
* In the \[Particle Thumbnail] section, replace the particle image with an error feedback image, such as "×".

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2FSNzrwItxOJzxTKFmEsmA%2Fimage.png?alt=media&amp;token=2abdce61-aaf4-4c97-a1f6-5d183bb431e5" alt=""><figcaption></figcaption></figure></div>

* Adjust the particle parameters according to the values in the image below.

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2FmqSkEuZPTh5nkefk08lg%2Fimage.png?alt=media&amp;token=1cc8bcf8-b55e-44df-87ee-df8f863087d3" alt=""><figcaption></figcaption></figure></div>

* Select multiple layers (particle, draggable image, etc.) to group them together, and then hide the particle layer.

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2FcpNUssB2vXitNr2PCsUS%2Fimage.png?alt=media&amp;token=ff962ead-70e0-4863-af6c-804548793fdd" alt=""><figcaption></figcaption></figure></div>

* Add a Trigger event to the drag group - **Not dragged to target position**, and set the drag area.
* Add response events: Display particle effect. Play the error sound effect once from the start.

<div align="left"><figure><img src="https://695199083-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4PyzU9CRLR4XKbxmIEid%2Fuploads%2FlyHn354225Lu4icRFsXY%2Fimage.png?alt=media&amp;token=3213c45b-ff5c-4c61-89d8-65b1be7c471f" alt=""><figcaption></figcaption></figure></div>
