I'm having issues with my node count rising continuously as the SKEmitterNode is going. I have the particleLifetime and the numParticlesToEmit set low. However, it doesn't seem that they're being removed. I've attached a few images to that shows the node count of the scene as the particles start.
I watched a tutorial of someone using the fire emitter and it showed that the node count was receding after the particles lifetime were up. Another confirmation that they aren't removing from the scene is that my memory is rising and not flattening out. If anyone could help me out or give me some guidance I would greatly appreciate it :) Thanks so much!
func releaseParticles(location: CGPoint) {
// SKEmitterNode(s)
particleEmitterBlastUp = SKEmitterNode(fileNamed: "ParticleBlast")
particleEmitterBlastLeft = SKEmitterNode(fileNamed: "ParticleBlast")
particleEmitterBlastRight = SKEmitterNode(fileNamed: "ParticleBlast")
//If: the SkEmitters are valid
if let particlesUp = particleEmitterBlastUp,
let particlesLeft = particleEmitterBlastLeft,
let particlesRight = particleEmitterBlastRight {
//Setup SKEmitters
particlesLeft.numParticlesToEmit = 2
particlesLeft.particleLifetime = 2
particlesLeft.xScale = 0.23
particlesLeft.yScale = 0.23
particlesLeft.zPosition = -1.99
particlesLeft.position.x = location.x
particlesLeft.position.y = location.y + (20)
particlesLeft.xAcceleration = -300
//Add to: the scene
self.addChild(particlesLeft)
particlesRight.numParticlesToEmit = 2
particlesRight.particleLifetime = 2
particlesRight.xScale = 0.23
particlesRight.yScale = 0.23
particlesRight.zPosition = -1.99
particlesRight.position.x = location.x
particlesRight.position.y = location.y + (20)
particlesRight.xAcceleration = 300
//Add to: the scene
self.addChild(particlesRight)
}
}