2

I want the same effect than in this project

But my particles SKEmitterNode isn't directly in the Scene, but in a child node. My particles are reactor effect behind my spaceship, and I want it to leave a trail on the scene as the SpaceShip node moves.

Right now my particles are a child node of my SpaceShip and so, "all" particles move with the SpaceShip so it display just a point and doesn't leave a trail.

How can I do it ?

Tancrede Chazallet
  • 7,035
  • 6
  • 41
  • 62

2 Answers2

5

You need to set the targetNode on your emitter to be your SKScene.

ABakerSmith
  • 22,759
  • 9
  • 68
  • 78
0

I am using this one to make a trail behind a ship in swift by SKEmitterNode.`

sparkEmmiter.targetNode = self.scene

Where sparkEmmiter is a object of SKEmitterNode. and make it to child of the ship.

ship.addChild(sparkEmmiter)

Where ship is SKSpriteNode object.

Raksha Saini
  • 604
  • 12
  • 28