I added SKEmitterNode as a childNode of my mainScene and than expected that It would be removed when particleLifetime
ends, described like apple docs.
Added emitters like this;
var emitterPath : String = NSBundle.mainBundle().pathForResource("ShipFire", ofType: "sks")!
var emitter : SKEmitterNode = NSKeyedUnarchiver.unarchiveObjectWithFile(emitterPath) as! SKEmitterNode
emitter.position = position
emitter.particleLifetime = 0.1;
self.addChild(emitter)
My SKEmitterNode properties like image below
When I run it emitters aren't removed from screen.
I don't know what to add more if you need more information please ask any help would be appreciated thanks.
particleLifetime determines the average lifetime of a particle, in seconds. That doesn't affect on removal of SKEmitterNode from parent.
numOfParticlesToEmit which refers to Maximum field in Particles area of Particle Editor determines the number of particles that emitter should emit before stopping. That doesn't affect on removal of SKEmitterNode from parent too. Also note that you've set 0 in this field which will enable infinitely emitting.
So, if you want to remove node from parent when emitter is done with emitting, you can set the number of particles to emit (field called Maximum in Particles area inside editor) and run an SKAction sequence which will:
Here is an simple example to show you how to do this with SKAction sequence:
And here is the result (note how node's count is changing after emitting is done) :
Hope this helps
EDIT:
For those interested in how to make similar effect like from the video above, try with something like this:
The point is to use Color Ramp, and to choose Add for a blend mode.
Here is the dropbox link to the .sks file : Effect.sks
Set your Particle "BirthRate" and "Maximum" both to 20. Setting the max to 0 will repeat the birth.