Cannot queue_free() an instanced CPUParticles2D Scene

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Captain.Susuwatari

Hey folks,

i would like to know how exactly i can delete/queue_free an instanced CPUParticles2D Scene (See Screenshot below for Setup/Script of Scene)?
I simply cannot make that work as with other nodes…

Problem: I’m making a spaceshooter where i instance that exploding-scene on a shot enemy…it “explodes” (particles emitting points) → i instance that (particles-)scene at the position of the enemy…but the queue_free() on that particle-scene doesn’t do anything, i can still see the remaining CPUParticles2D-Instances in the Remote-Debugging-Window no matter what i do.
Even if i force it, calling “free()” - does not free it.

What is a better approach of dealing with emitting particles on multiple positions at the same time or “deleting” that nodes?

(I searched the net and found an answer that i should keep “the” emitter and just change the position…but the problem remains that if i have a lot of enemies that explode at the same time, i need to instance multiple CPUParticles2D at the same time)

Setup Exploding-Scene: Particles2D-Setup

Thank you in advance!

Works fine for me. Can you provide an example project?

njamster | 2020-09-05 13:01

:bust_in_silhouette: Reply From: Captain.Susuwatari

Found a solution: I just needed to make a “Node2D” as parent and queue_free() that…than it works…thank you kindly for reading.