# Particle Emitter: Set emit zone to a circle and have the particles move towards the center

**URL:** <https://phaser.discourse.group/t/particle-emitter-set-emit-zone-to-a-circle-and-have-the-particles-move-towards-the-center/2379>\
**Category:** Phaser 3\
**Created:** [May 8, 2019, 3:02pm UTC](https://phaser.discourse.group/t/particle-emitter-set-emit-zone-to-a-circle-and-have-the-particles-move-towards-the-center/2379 "2019-05-08T15:02:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jake.Caron](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/jake.caron/32/1841_2.png) [@Jake.Caron](https://phaser.discourse.group/u/Jake.Caron)\
**Post date:** [May 8, 2019, 3:02pm UTC](https://phaser.discourse.group/t/particle-emitter-set-emit-zone-to-a-circle-and-have-the-particles-move-towards-the-center/2379/1 "2019-05-08T15:02:01Z")

</div>

Greetings!  
As the title suggests, I am trying to create a particle effect that moves the particles towards the center of a circle. Currently it is easy enough to move the particles strictly away from the center, but there doesn’t seem to be a good way to move them towards the center.

Any help or suggestions are greatly appreciated. Thanks!

---

<div class="post-metadata">

**Author:** ![prob](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/prob/32/628_2.png) [@prob](https://phaser.discourse.group/u/prob)\
**Post date:** [May 8, 2019, 5:35pm UTC](https://phaser.discourse.group/t/particle-emitter-set-emit-zone-to-a-circle-and-have-the-particles-move-towards-the-center/2379/2 "2019-05-08T17:35:22Z")

</div>

You can define a Circle/Ellipse emitZone in your emitter config, along with moveToX/moveToY values.

```
   this.shape = new Phaser.Geom.Ellipse(400, 400, 300, 300);
   this.particles = this.add.particles('particleTexture');
   this.emitter = this.particles.createEmitter({
        moveToX: 400,
        moveToY: 400,
        lifespan: 200,
        alpha: { start: 0, end: 0.7 },
        speed: 2000,
        scale: { start: 0.5, end: 1 },
        emitZone: { source: this.shape }
    });
```

---

<div class="post-metadata">

**Author:** ![Jake.Caron](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/jake.caron/32/1841_2.png) [@Jake.Caron](https://phaser.discourse.group/u/Jake.Caron)\
**Post date:** [May 8, 2019, 8:10pm UTC](https://phaser.discourse.group/t/particle-emitter-set-emit-zone-to-a-circle-and-have-the-particles-move-towards-the-center/2379/3 "2019-05-08T20:10:25Z")

</div>

Thanks Prob! that’s definitely a good solution to the proposed problem.

Do you know if there is a way to make it not hit the center though? I would prefer the particles to move towards the center, but not touch it.

---

<div class="post-metadata">

**Author:** ![prob](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/prob/32/628_2.png) [@prob](https://phaser.discourse.group/u/prob)\
**Post date:** [May 9, 2019, 6:26pm UTC](https://phaser.discourse.group/t/particle-emitter-set-emit-zone-to-a-circle-and-have-the-particles-move-towards-the-center/2379/4 "2019-05-09T18:26:22Z")

</div>

You could fiddle with the lifespan and speed, so that they never make it to the center. Or perhaps add a deathZone to the config.

---

<div class="post-metadata">

**Author:** ![Jake.Caron](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/jake.caron/32/1841_2.png) [@Jake.Caron](https://phaser.discourse.group/u/Jake.Caron)\
**Post date:** [May 9, 2019, 6:33pm UTC](https://phaser.discourse.group/t/particle-emitter-set-emit-zone-to-a-circle-and-have-the-particles-move-towards-the-center/2379/5 "2019-05-09T18:33:33Z")

</div>

Unfortunately the speed doesn’t actually do anything. The speed is dictated by the lifespan when you use the moveTo properties. The death zone would also make it blink out of existence instead of fade out, unless there is was some way I could customize how the death zone interacted with the particles…
