Dat particle emitter

Hey is it possible for me to set the amount of time my emitter will keep attaching new particles?
Currently, when a spell is cast, the emitter is attached to the rootNode and moves forward for a certain time, like say 10 seconds, then is detached, then the spell object removed from my spell arraylist, but would it be possible for my spell to stop emitting new particles after just a couple of seconds, but keep the ones it currently has until all the particles are gone before detaching it from the rootNode, so instead of a full emitter suddenly disappearing, it kinda just fades out, then gets detached…?

That’s certainly possible with the new ParticleController system. I can’t remember if its possible/easy with the old system.


1 Like

And which particle system am I using? I.e is the new one integrated with the sdk in the scenecomposer & the hello effects tutorials cover it or is that for the old system?

Hello effects is the old system.

The new system I was going to release as a plugin but the build was broken which made it awkward. I’m not sure if it’s possible again yet. It’s not “official” but provides a lot of nice functionality.

It’s in the contribution repository though and documented in the wiki.

You can do that with the built in emiter.
Just have a control attached to it that set the num particle to emit to 0 after 10 seconds. the emitter will stop to emit new particles but the ones already emitted will continue their life cycle.

Then inthe control you just have to check emitter.getNumVisibleParticles() and remove the control from the scene graph when it reaches 0.