← Yop2D

How to make a timer?

Beginner guide · no code

Français · English · Español · Deutsch · Italiano · Português · Русский · 中文 · 日本語 · العربية

ℹ️ For Yop2D Next, the new 2D + 3D version of Yop2D (coming soon). Button and node names are those of Yop2D Next.

🔍 How do I…? All short recipes, with a search

A countdown: 30, 29, 28… then “Time's up!”. A single Repeat node does all the work.

You need:

Step 1: the temps variable

  1. Left panel, Scene tab, GAME VARIABLES section: tap New variable. Name (no spaces): temps; Type: Whole number; Starting value: 30. Then Apply.

Step 2: the text

  1. Tap Object → Texts → Text.
  2. Name it temps_label and type 30 in its Text line.

Step 3: the nodes

  1. Open the Blueprint.
  2. On Start → Repeat: Every (seconds) 1, Number of times (0 = endless) 30.
  3. Each time output → Add to Variable (Variable temps, Value to add -1) → Modify Text: Object temps_label, New text =temps
  4. Finished output → Modify Text (Object temps_label, New text Time's up!)

The nodes

On Start
→
Repeat1 · 30
Each time →
Add to Variabletemps · -1
→
Modify Texttemps_label · =temps
Repeat
Finished →
Modify TextTime's up!

Try it

Tap Play: the text counts 30, 29, 28… then shows “Time's up!”.

👉 Instead of the last Modify Text, you can use Pause the game or Go to scene (a “You lost” screen).