CPUParticles2D reparenting causes flicker

Godot Version

v4.2.2.stable.mono.custom_build [15073afe3]

Question

I have a CPUParticles2D that’s been emitting for a while, while parented under Node A. If I reparent the particles to Node B, there’s a one frame flicker where the particle system disappears. It does this regardless of whether the reparenting is via a deferred call or not. Is there anything I can do to prevent this?

My use case is: particles are attached to a node which has died in the game. But I want the particles to linger until the emission is done. I know I can do gross hacks like not parent the particles to the node in the first place, but I would prefer to avoid that if possible.

Thanks!

(btw the “custom_build” in my version is the Spine build of Godot, i don’t think it’s related)

Since it sounds like the particle emission is one-shot, Why not free the dead node after the emission ends via the finished signal?

Otherwise get an animation player involved to orchestrate the death.

Hi, thanks for the response - and I do do what you’re saying. But the particle system is under a node that’s dying NOW, which is why I want to reparent in the first place. IOW what I’m trying to solve is that the PFX is dying too early due to being a child of something that needs to do right now. I reparent to avoid that, but the reparent causes the flicker.

K, I understand. I don’t have a root cause solution. and I don’t want to read Godot source code ATM.

I also assume by you description That at least the particles persist the reparenting and are not restarting their emission.

So it is likely a drawing bug?..

I guess I was offering bandaid solutions, avoiding reparenting, or non parent solution.

If you use an animation player could you hide the parent sprite/mesh? Get the same visual effect as deleting by hiding it. And delete it later when your particle effect is over.

I would also say that having a global particle system manager for one off effects is a valid solution. I use one for myself for bullet collision effects. But if this is like smoke or something and the object is moving, I would just do some slide of hand with an animation player. Which can call functions btw. It can call queue_free() for you.