Should I instantiate texture particles with Particle2D node or just instantiate and destroy Sprite nodes?

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

I have a “ghost trail” effect I want to achieve, and am currently doing it by instantiating a scene with a Sprite node and this script attached:

extends Sprite

func _process(delta):
    modulate.a = lerp(modulate.a,0,0.1)
    if(modulate.a < 0.01): queue_free()

Naturally, I could end up with a bunch of them on screen, depending on the rate at which I’m instantiating them, and how long they remain etc. I’m pretty sure I can do the same thing using a Particle2D node. What I want to know is do the particles emitted by Particle2D node offer any benefit over manually instantiating Sprites and destroying them?

:bust_in_silhouette: Reply From: Tim Martin

Yes, the properties of all of the individual particles spawned by a Particle2D node are computed on the GPU. So while you have overall less control than you would with a bunch of sprites, you will get much higher performance.