← Yop2D

How to hide and show an object?

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

Two buttons: Hide makes a chest disappear, Show brings it back. Just one node: Visibility.

You need:

Step 1: the object

  1. Put an object in the scene (an image or a Square) and name it coffre.

Step 2: the two buttons

  1. Tap Object → Interactive → Button with text.
  2. Name it cacher and type Hide in its Text line.
  3. Tap Object → Interactive → Button with text.
  4. Name it montrer and type Show in its Text line.

Step 3: the nodes

  1. Open the Blueprint.
  2. On Object Click: Object cacher → Visibility: Object coffre, Visible (yes / no) No
  3. On Object Click: Object montrer → Visibility: Object coffre, Visible (yes / no) Yes

The nodes

On Object Clickcacher
→
Visibilitycoffre · No
On Object Clickmontrer
→
Visibilitycoffre · Yes

Try it

Tap Play, then Hide: the chest disappears. Tap Show: it comes back.

👉 A hidden object can still touch others. To remove it for good, use Destroy Object.