Newbie: ParticleEmitter & killAllParticles

Hello,



I am a newbie to jme 3.

I have written an app that uses the ParticleEmitter.

All works fine apart from the fact that killAllParticles does not kill the particles being emitted.

I have about 1000+ instances of ParticleEmitter, each of them triggering an emission at different times.

However, on start-up, they emit by default.

killAllParticles does not work.



Any idea?



The only work around I have found is to remove the node from the scene… which is something I would like to avoid.



Subsidiary question: any news on the final release of the SDK?



Thank you and kind regards

Don’t know if this is appropriate to what you are doing but I switch my “jet engine” off by doing



[java]fire.setParticlesPerSec(0f);

[/java]



EDIT: I’m always to quick with the “Post”-button. Alos, the emitters have a setEnabled that might do the trick, haven’t tested that yet.

1 Like

actually setEnable(false) prevents the particles to update, so if they are emitted, they just stay still, so that’s probably not what you want.

Also you can cull it from the scene emitter.setCullHint(CullHint.Always). But it will suddenly disappear on next render.



@jmaasing way of doing it is probably the best in term of visual result for an emitter. because the emitter will stop emitting new particles and the emitted particles will just live their own life until they fade away.

2 Likes

Yeah, I was thinking the OP said it was at startup, so maybe setEnable(false) in initalize and then setEnable(true) in some game related event would be appropriate for the use case. Especially if they are emitAll explosion like stuff.



But then the emitters should probably be switched off at some point so depending on the use case we are probably back to setParticlesPerSecond :slight_smile:

Works perfectly. Thank you very much