← Yop2D

How to make a camera that follows the hero?

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

Just one node, Follow with camera, and the camera stays on your hero, even when it goes further than the screen.

You need:

Step 1: the hero

  1. Put an object in the scene (an image or a Square) and name it heros.
  2. Select heros, tap ⚙ Object behavior in the Inspector and choose Top-down character.
  3. Tap Object → Interactive → Joystick.

Step 2: the nodes

  1. Open the Blueprint.
  2. On Start → Follow with camera: Object heros

The nodes

On Start
→
Follow with cameraheros

Try it

Tap Play and move your hero: the screen follows it.

👉 To stop the camera at the edges of your level, add Camera limits right after. To see further ahead of the hero: Object further right on screen (pixels, 0 = centre, negative = left) setting.