ℹ️ 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 pause button that freezes the whole game, and a Resume button that appears during the pause. Both buttons go in a HUD: a scene laid over the game.
You need:
- a 2D project open in Yop2D Next.
Step 1: the HUD scene
- Left panel, Scene tab, SCENES section: tap New scene, choose 2D scene and call it HUD.
Step 2: the two buttons
- Tap Object → Interactive → Button with text.
- Name it pause and type II in its Text line.
- Tap Object → Interactive → Button with text.
- Name it reprendre, type Resume in its Text line, and untick Visible in the game in the Inspector: it is hidden at the start.
Step 3: the HUD's nodes
- Open the Blueprint.
- On Object Click: Object pause → Pause the game → Visibility: Object reprendre, Visible (yes / no) Yes
- On Object Click: Object reprendre → Resume the game → Visibility: Object reprendre, Visible (yes / no) No
Step 4: open the HUD
- Tap the first scene in the list (the game's) and open its Blueprint.
- On Start → Open a HUD: Scene HUD
The nodes
On Object Clickpause
→
Pause the game
→
Visibilityreprendre · Yes
On Object Clickreprendre
→
Resume the game
→
Visibilityreprendre · No
On Start
→
Open a HUDHUD
Try it
Tap Play: the II button is at the top. Tap it: everything stops and Resume appears. Tap Resume: the game goes on.
⚠️ The buttons must be in the HUD: during the pause, the game scene no longer reacts, but the HUD keeps going.