ℹ️ 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 Fire button: each tap shoots a bullet from the hero. The bullet is a hidden model: Yop2D makes a copy of it for each shot.
You need:
- a 2D project open in Yop2D Next.
Step 1: the hero
- Put an object in the scene (an image or a Square) and name it heros.
Step 2: the shot's model
- Put an object in the scene (an image or a Square) and name it balle.
- Make it small and untick Visible in the game: it is the model, Yop2D makes copies of it.
Step 3: the button
- Tap Object → Interactive → Button with text.
- Name it feu and type Fire in its Text line.
Step 4: the nodes
- Open the Blueprint.
- On Object Click: Object feu
- Shoot an object: Object heros, Model name balle, Direction 0 (to the right)
The nodes
On Object Clickfeu
→
Shoot an objectheros · balle · 0
Try it
Tap Play, then Fire: a bullet flies to the right. It disappears when it leaves the screen.
👉 Direction: 0 = to the right, 90 = down, 180 = to the left, 270 = up.