Swift 2 SKEmitter Problem?

All,

Before Apple released Swift 2 and Xcode 7 I was using the following Swift code to display Particles. It worked like a charm. Then the updates to Swift 2 and the particles just will not render and display. Here is the code does anyone know how I can fix it?


let sparkEmitter = SKEmitterNode(fileNamed: "zombie_slice.sks")
                sparkEmitter!.name = "sparkEmitter"
                sparkEmitter!.zPosition = 1
                sparkEmitter!.targetNode = self
                sparkEmitter!.particleLifetime = 1
               
                sparkEmitter!.position.x = self.player.position.x
                sparkEmitter!.position.y = self.player.position.y
               
                self.addChild(sparkEmitter!)
               
                let actionDone = SKAction.runBlock({self.zombieDeathSequenceEnded(node as! SKSpriteNode, zombieNumber: zombieToUseForDeathSequence as Int, theEmitter: sparkEmitter!)})
                node.runAction(SKAction.sequence([zombie_death_anim, actionDone]))

I use touchBegans in location to display particle, here is the things i met:


1. If the particle is runforever(Maximum = 0), it will display by touch


2. If Maximum !=0 ,just let particle run in few seconds , it will not display by touch. I added codes : particleName.resetSimulation() after addChild,it worked.


Hope this can help you.

Swift 2 SKEmitter Problem?
 
 
Q