As of Godot 4.8, particle attractors are 3D only - GPUParticles2D has none. This kit adds them.
Select your GPUParticles2D, press "Make attractable" in the inspector, add a PDAttractor2D node and pick a mode. Your existing particle settings are copied over (Ctrl+Z to undo).
6 ATTRACTOR MODES
- Attract - pull particles toward a point
- Repel - push them away (shields, bubbles)
- Vortex - swirl around a point, spiral in or out
- Seek - particles fly freely, then turn and fly to the target and disappear on arrival: coins into the HUD counter, XP orbs into the player
- Shockwave - one expanding ring that blasts particles away (call shockwave() from your explosion)
- Wind - blow particles in a direction inside a zone
Works across CanvasLayers and cameras: put the attractor on a HUD icon and world particles fly to it, whatever your Camera2D position or zoom. Particles with local coords on or off, rotated or scaled nodes - all converted for you.
12 READY-MADE PRESETS
Coin Burst (spinning coins to your counter) - XP Orbs - Gem Magnet - Soul Drain - Black Hole - Vortex Swirl - Shockwave Push - Wind Gust - Repel Shield - Fireflies Follow - Healing Gather - Mana Absorb
Fast: the attractor math runs on the GPU inside the particle shader. On an old GeForce GT 630 (Compatibility renderer), 40,000 particles with 4 attractors stayed at 60 fps.
Included
- the particle shader (emission shapes, velocity, gravity, damping, spin, scale curve, color ramps, sprite-sheet animation + up to 8 attractors per system)
- PDAttractor2D, PDAttractable2D, a converter for ParticleProcessMaterial, an inspector button
- 12 preset scenes + the code that builds them (read every value)
- a demo stage: coin chest + HUD counter, hero, enemy, every preset, click to burst
- textures made for this kit: 8-frame spinning coin, orbs, sparkle, wisp, gem, leaf, dust
- README with setup, FAQ and limits, AGENTS.md for AI coding assistants
GPUParticles2D only (not CPUParticles2D). Max 8 attractors per particle system at once (the nearest). No audio included.
Every script was written for this kit - safe to use in a game you sell.
Tested in Godot 4.7 (Compatibility renderer). Built with no Forward+-only features.
No AI-generated images. Code written with AI assistance.
License: use in personal and commercial projects. Do not resell or redistribute the files.
