deathZone on particles via Global cords?

So im doing something a little weird, where I can the perfect results of a projectile by moving my particle holder itself. the result looks like:

particles = this.add.particles('flares');        
emitter = particles.createEmitter({
    x: -1000,
    y: 100,
    angle: { min: 181, max: 179 },
    size: {min:1,max: 1},
    speed: 400,
    gravityY: 0,
    scale: { start: 0.4, end: 0 },
    lifespan: { min: 1000, max: 2000 },
    blendMode: 'ADD',
      deathZone: { type: 'onEnter', source: rect }
});

is the emitter

The problem is, because im moving the partciles.x when the particles hit the deathZone rect, they are not killed.

Im not sure the best solution here? trying to move the emitter by using a min and max X with steps, does not provide the right result (plus the particles by default are moving to the left, so they will never hit the deathZone without the global right movement.

Im guessing I could make a custom contains on it, and try to then take the X and Y the emmiter passes and globalize them. But there has to be a better solution?


the end goal is this is a projectile, and when it collides, it looks weird if the trail doesn’t continue into the enemy

=========================
Update

So yeah,

doing a custom hit made it do what I want… but this till feels like a bad way to do this

let test = {
    
    contains: function (x, y) {
            console.log(particles.x + x);
            if ((particles.x + x) >= 1000) {
                return true
            }
        
    return false;
}
}

How are you moving the emitter?

im moving the emitter by moving the emitterManager itself. As moving the emiters emite location makes it looks choppy (not a solid projectile)

I think it should work if you change the emitter location instead. Or use follow.

i’ve trierd both of those, but the particle system does not look as smooth. Ill have to make a gif to show an example. You might know a solution when you see the problem it makes

Can you show me the code for moving the manager?

Can also use an edge zone (see shape4).

So I think this gif will show what I mean better:

The issue when moving the emitter (either by follow, or by adding steps) spread the particles out to much (and does not look as nice as above) I spent about 30 mins trying to keep it follow or steps based, and increase number of particles, speed, size… you name it, to make it have the same thickness as the gifs above, but nothing pulls it off as nice as moving the manager itself.


as for my code of moving the manager, im simply doing a

this.particles.x =+ speed * delta

I mean in theory, the code I have in the first post now works, with the custom “contains” function adding the position of the manager to the particle X… It just feels like it’s not the right way to do this?

With setPosition():