ℹ️ 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
An enemy that walks on its own on its ground and turns around at the edge. The Patrol (back and forth) behaviour does everything.
You need:
- a 2D project open in Yop2D Next.
Step 1: the ground
- Put an object in the scene (an image or a Square) and name it sol.
- Stretch it so it covers the whole width of the screen.
- Select sol, tap ⚙ Object behavior in the Inspector and choose Ground / wall.
Step 2: the enemy
- Tap Object → Shapes → Image: the Library opens. Family Enemies & animals: tap an enemy, then With its animations.
- Name it garde. Put it on the ground.
- Select garde, tap ⚙ Object behavior in the Inspector and choose Patrol (back and forth).
The nodes
No node needed: the behaviour does everything.
Try it
Tap Play: the enemy goes from one edge of the ground to the other, without falling.
👉 It turns around at the edge of its ground (it doesn't fall into the void) and against a wall. The library enemies face left.