What's the best method to use particles?

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

So my character have an attack sequence, i set the emitting particle to true, but it works only on first attack, and not in the others, maybe this happen because of it is set to true now? So what is the best method to use particles system? I use the activate/deactivate method? Or maybe i create a scene for the particle and instantiate him in the moments i want, and destroying after?

:bust_in_silhouette: Reply From: gmaps

Its always better to reuse but it has its limitations.

If you need parallel instances e.g. one is not finished emittinh yet and you want to start a new one (emitter lasts longer than buffer time of attacks) its better to instance a new object.
If you want to override the material in case it hits a different surface (e.g. enemy instead of wall) its more convenient to create a new object so you dont have to change it back every time.

So my suggestion is create a new object every time as it gives you more flexibility. And if you realize you dont need parallel emitters you can always go back to reusing.

And dont forget to dequeue instances you dont need anymore.