Particle system question

Hi

I have a problem with a particle system, and I am likely just doing it wrong.

What I have is a particle system that is a child of a container (the light gray part on the image below). I then have four move actions (in a repeatforever sequence) that moves the particlesystem using cc.moveBy commands, the result is that it moves it around in a square like the one you see below. This is the desired result…

The Problem:
When I change the scale of the root canvas - this scaling seems to not be applied correctly to the particle emitter. I just cannot seem to figure out how to fix it. You can see what happens when i cange the scale of the root canvas on the gif below - the particle system still moves in a square but the emitter seems to scale down or something.

If anyone has a tip how to fix it please let me know :slight_smile:

Best Regards
Peter

Really stuck on this one, so i hope someone has a tip to what I am doing wrong please give a hint :wink: Or is it an error in cocos?

Can you try tweaking particles Position Type option?

solution:fix Particle system bug

Still have similar bug with particles. Cocos creator version is 2.1.0.

  1. Strange particles behavior when particles nodes updated from Animation. The only workaround that I found is to update particles nodes from code manually.
  2. Particles blinking after reactivating node: turn off node, turn on node, call resetSystem(). Have one frame of blinking particles in the old place.

My workarounds for particles:

  1. For particles in Animation I replace update() function with lateUpdate() function
    Attention! This is hack!
    for (let i = this.particles.length - 1; i >= 0; --i)
        {
            let p = this.particles[i];
            p["updateFunc"] = p["update"];
            p["update"] = function (dt: number): void
            {
            }
            p["lateUpdate"] = function (dt?: number): void
            {
                this["updateFunc"](dt);
            }
        }
  1. To get rid of particles blinking after reactivation I call particles update() manually (In my case it’s lateUpdate()
        for (let i = this.particles.length - 1; i >= 0; --i)
        {
            let p = this.particles[i];
            p.resetSystem();
            (p as any).lateUpdate(0.01);
        }