← Yop2D

How to change the animation with the movement?

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 hero that walks when it moves, plays the jump animation in the air and stands still at rest. The Platform character behaviour picks the animation on its own.

You need:

Step 1: the ground

  1. Put an object in the scene (an image or a Square) and name it sol.
  2. Stretch it so it covers the whole width of the screen.
  3. Select sol, tap ⚙ Object behavior in the Inspector and choose Ground / wall.

Step 2: the hero

  1. Tap Object → Shapes → Image: the Library opens. Family Characters: tap a character, then With its animations.
  2. Name it heros.

Step 3: the controls

  1. Select heros, tap ⚙ Object behavior in the Inspector and choose Platform character.
  2. Further down, ANIMATIONS PLAYED AUTOMATICALLY section: Yop2D has already sorted the animations (Standing still, Walking, In the air…). Touch a line to choose another animation.
  3. Tap Object → Interactive → Joystick.

The nodes

No node needed: the behaviour does everything.

Try it

Tap Play and push the joystick: the hero walks with its animation, jumps, then stops and plays the idle animation again.

👉 With your own images: give your animations names that contain “walk”, “jump” or “idle”, or pick them by hand by tapping the lines.