A way to create a one-time force to push GPUParticle2D away

Godot Version

v4.6.2.stable.mono.official [71f334935]

Question

I ran into an issue that feels like it should have a very simple solution, yet I couldn’t really find anything that didn’t feel like a complete hack.
I understand that in 3D, there’s a node called GPUParticlesAttractorSphere3D, but nothing of the sort seems to exist for 2D.

My problem: I have some dust particles flying through my scene with a bit of turbulence, and there’s a small “explosion” that happens around the middle, and I want to have a brief and small force that causes all the dust particles to be repelled from that position.

But there doesn’t seem to be a simple solution to this at all. I know that LightOccluder2D nodes can interact with particles, but briefly spawning then removing one causes those particles to move in a very unnatural way, and they will pick up the shape of the Occluder, which doesn’t feel right and looks very off / artificial.

I think the Sub Emitter is your solution.

I’ve never used it, but my feeling is that you can use that to trigger basically a secondary explosion. Then you could figure out how to EOL the particles as the new ones are expanding, creating the illusion that the same particles are being blasted outwards.

Unfortunately, Godot docs seem to agree:

Particle attractors are not yet implemented for 2D particle systems.

Perhaps experiment with having your LightOccluder2D rapidly expand instead of spawning in full sized? If that fails, you probably could work around the problem by using MultiMeshInstance2D instead of the designated particles node, which will let you apply forces as you please. It won’t be as performant and need a bit extra effort, but it should work.

Stein posted a similar problem recently on r/godot and he found a somewhat hacky solution, maybe this could work for you too?
https://www.reddit.com/r/godot/s/S1hX59A66p

And there is this proposal, you might want to put a like on:

Why not just implement your own in particle process shader?

That actually worked perfectly because the scene where I needed this was completely static, thank you!

I removed all the NDA-risk stuff so I can technically show this.

Cool effect!

I added the screenshot of the post I linked, so that it can still be referenced in case it’s ever removed from Reddit.

Very cool.