I have a SKEmitterNode
that's running on a SKScene
and I want to move it to the next SKScene
without interrupting the particles.
Normally I'd do it like the following:
let scene: SKScene = GameScene(size: self.size)
let transition = SKTransition.crossFade(withDuration: 0.5)
self.view!.presentScene(scene, transition: transition)
And then on the next SKScene:
override func didMove(to view: SKView) {
particleEmitter.removeFromParent()
addChild(particleEmitter)
}
This works perfectly fine however in this situation I don't want to use a transition when moving to the next SKScene. I've tried it without a transition like:
let scene: SKScene = GameScene(size: self.size)
self.view!.presentScene(scene)
And the SKEmitterNode
disappears as soon as the new SKScene
is presented even though I've removed it from the last SKScene
and added it as child to the new one.
My question is why is the SKEmitterNode
dissapearing and how can I get it to work without using a transition between the SKScene's. Any help would be much appreciated, thanks.
Note: Using a SKTransition
with a duration of 0 also works but this causes a noticeable 'flash' during the transition.