Moving particle emitter moves particles as well

I have a particle system that follows another node.

Yet when I move the emitter to follow the ball, the particles themselves seem to jump with the ball.

ccparticles

This seems to be a bug with the emitter but is there a workaround?

Thanks in advance

i think this is probably because the particle pieces are anchored to the center of the emitter and when you move the emitter it moves the center anchor which makes the pieces jump

Can you show the code for the bouncing ball and the following emitter?

– Edit –

The more I look at it, now I notice that it only jumps in the Y direction and not in the X direction, do you have width/height defined on the emitter?

I didn’t have the width / height set previously but I do now and it didn’t make any difference.

Unfortunately I can’t share all the code but the gist if it is:
The ball script has the particle system assigned through the editor and I use physics (applyImpulse) to make the ball jump on click. On lateUpdate I assign the particle systems position to the balls position.

lateUpdate() {
  this.ballTrail.node.position = this.node.position;
}

Ok, I fixed it by changing the engine code.

I had to emit an after-step event at the last line of the update method in the physics manager. Then listen for that instead of using lateUpdate.

1 Like

You should submit this as a pull request :slight_smile: