What it does
The pack registers twelve named effects with the 3D particle system. Spawn one with
game.particles3d.effect(name, opts). A one-shot ends by itself; a loop stays until kill(), or stop(), which lets
the sparks already in the air finish.
Every spark faces along its velocity and stretches with its speed, falls under real gravity, and is additive and unlit,
so it glows whatever the scene's light. Round the sparks is what makes each effect read as itself: a flickering glow
at the source, falling grit, a flash, a ring, smoke or fumes, and the fumes and smoke take the scene's light. scale
grows every size, speed, distance and zone together, gravity included, so the motion keeps its shape: sparks at
scale: 0.4 is a fizzing wire, and anvil at scale: 2 a steam hammer.
Features
- Workshop loops —
welding, a flickering blue-white glare with spatter and fumes;grinder, a dense jet of long sparks aimed withyawandpitch; andsparks, a fountain spurting about three units up. - Electrical faults —
electric, arcs jittering round a pulsing core, andshortCircuit, flashes and molten sparks popping on an uneven beat. - Hits —
ricochet, needle sparks skipping off a floor;metalHit, a clang on armour; andlaserHit, a cyan-white blaster strike that leaves a molten dot. - Forge and fire —
anvil, a ring of orange sparks thrown low and wide, andemberBurst, embers drifting up as a log breaks. - Set pieces —
sparkShower, sparks raining from a broken ceiling four units up, andsparkler, a white-hot head a character can carry. - Small budgets — the busiest,
grinder, holds about 260 particles at once, the one-shots 30 to 80.
Good for
- Shooters and mech games — ricochets, armour hits, blaster impacts and damaged machines.
- Melee combat — sparks when swords clash or a blow lands on plate.
- Sci-fi and industrial levels — severed cables, short circuits and a broken ceiling raining sparks.
- Crafting scenes — a welder, a grinder and a blacksmith's anvil.
Make it yours
Every effect takes a position, or an object to follow with an offset, plus scale, and yaw and pitch for the
aimed ones. A shooter fires ricochet on every bullet that strikes the floor, turned to the bullet's heading; a
workshop scene puts welding on a character's tool and plays anvil on every hammer blow. Every effect is a plain
Vfx3dDef: copy one from game.particles3d.defs, retune it and register it with registerVfx3d.
A quick look
A short circuit at head height, a sparkler in a hand and a grinder aimed sideways:
const fault = game.particles3d.effect('shortCircuit', { x: 2, y: 1.6, z: -4 });
const sparkler = game.particles3d.effect('sparkler', { follow: hand, offset: { y: 0.3 } });
const shower = game.particles3d.effect('grinder', { follow: tool, yaw: 90, pitch: 20 });
shower.stop(); // let the sparks in the air finish
Works with
particles-3dandparticle-textures— required: the runtime and the particle frames;core-3dincludes both.lighting-3dandaudio— a light for the glow of a weld, and the crackle and the clang.vfx3d-explosion,vfx3d-lightningandvfx3d-fire— a whole blast, a bolt or an arc, and a standing fire.vfx-sparks— the same twelve names in 2D.
Good to know
- Sparks do not collide with the world, so they vanish through the floor;
sparkShowersplashes at its anchor's height, which is why it is placed on the floor rather than at the break. - Spawn the impacts a little off the surface they hit, or the surface hides half of each flash.
yawandpitchdo not turn gravity: a grinder pitched up still rains its sparks down.- Sparks light nothing and cast no shadows: pair them with a light.






