1

I attached a SKEmitterNode to a SKSpriteNode. At the beginning, everything was fine. But after changing the parent node of the sprite node, particle effects stopped for some reason.

To attach the emitter node to the sprite node, in the sprite node class:

self.addChild(theEmitterNode)

In the game scene, I first attached the sprite node to NodeA, where particle effects worked as expected:

theSpriteNode.theEmitterNode.targetNode = self // self is the scene
nodeA.addChild(theSpriteNode)

But when I change the parent of the sprite node, particle effects stopped:

self.theSpriteNode.removeFromParent()
nodeB.addChild(theSpriteNode)

Any ideas how to solve it?

Elias Ma
  • 106
  • 4

0 Answers0