Titus Posted May 21, 2018 Share Posted May 21, 2018 Hello, Just a quick question. I want to kill any emitter particles that overlap with a sprite. I've tried: if(this.game.physics.arcade.overlap(this.emitter, this.sprite)) { this.emitter.removeChildAt(0); //and this.emitter.removeChild(); } Link to comment Share on other sites More sharing options...
samme Posted May 21, 2018 Share Posted May 21, 2018 Make sure you use collide=true in Emitter#makeParticles. Link to comment Share on other sites More sharing options...
Titus Posted June 4, 2018 Author Share Posted June 4, 2018 Hi @samme, thanks for the reply and sorry for my delayed one. I do have collide set to true in the makeParticles method and neither this.emitter.removeChild() or this.emitter.removeChildAt(0) remove the overlapping particle from the game world. They just move through it. Am i using these methods in the correct way (to remove the overlapping particles)? The overlap is definitely triggering because I have other stuff in the game that is working within the same IF statment. Link to comment Share on other sites More sharing options...
samme Posted June 4, 2018 Share Posted June 4, 2018 this.game.physics.arcade.overlap(this.sprite, this.emitter, function (sprite, particle) { particle.kill(); }); Link to comment Share on other sites More sharing options...
Recommended Posts