← Yop2D

How to add particles and effects?

Beginner guide · no code

Français · English · Español · Deutsch · Italiano · Português · Русский · 中文 · 日本語

Yop2D makes particles in two ways: the “Particle effect” node fires a burst all at once (perfect for an explosion), and the Particles object produces them non-stop (fire, smoke, rain, trail…). Other nodes add effects over the whole screen: flash, tint, vignette and fade.

You need:
👉 To see all these effects in action, open the Effects showcase example on the Yop2D home screen: one button per effect, with the name of the node to use.
On video: every effect from the Effects showcase example, made without a single line of code.

Step 1: an explosion when you touch an enemy

  1. Open the scene's Blueprint.
  2. Add the “If object touches Tag” event: target player, Tag ennemi.
  3. Add “Particle effect”. As the target, choose The object involved in the event: it is the enemy the player just touched. Preset: Explosion.
  4. Add “Destroy Object”, with the same target The object involved in the event.
  5. Link the three nodes in order, then start the game and touch an enemy: it explodes before disappearing.
If object touches Tagtarget: player · Tag: ennemi
→
Particle effectImplied Object · Explosion
→
Destroy ObjectImplied Object
⚠️ Order matters: “Particle effect” must come before “Destroy Object”. Once the enemy is destroyed, there is no object left to place the explosion on.
👉 You can change the color (for example #FF40D0 for a magenta explosion) and the size (2 = twice as big). Also try Sparks, Confetti or Smoke.

Step 2: a trail behind the character

  1. Add an object: in the Effects category, choose Particles. In the editor it shows as a dotted orange area; in the game it is invisible.
  2. In the inspector, PARTICLES section, tap Preset: and choose Wake trail.
  3. Still in the inspector, tap the Parent: None button and choose player: the object will follow the character everywhere.
  4. Place it just behind the character, then start the game and move: a long glowing trail follows the character.
👉 Nothing to add in the Blueprint: a Particles object works on its own as long as Active when the game starts is checked. To turn it on or off during the game, use the “Particles on / off” node.

Step 3: effects over the whole screen

To move to the next level smoothly (see the levels guide):

Screen fadeFade out (to the color)
→
Wait1
→
Next scene

Then, in the next level:

On Start
→
Screen fadeFade in (from the color)
👉 The tint and the vignette stay under the HUD: the score and the buttons stay easy to read. The flash and the fade cover the whole screen.

Step 4: electrocution and hit stop

If it doesn't work