CharlesCraft50 Posted September 27, 2016 Share Posted September 27, 2016 I want to be able to destroy the bullet by collision, but if i use weapon.bullets.destroy();, all the bullets will destroy and the weapon will not work/fire() anymore. Like this: weapon.bulletKillType = Phaser.Weapon.KILL_WORLD_BOUNDS; //weapon.bulletKillType = //Kill the bullet when collision happens; or //weapon.remove(bullet); like in groups Link to comment Share on other sites More sharing options...
jopcode Posted January 14, 2017 Share Posted January 14, 2017 I want same to, but i don't know how do, any idea? Link to comment Share on other sites More sharing options...
CharlesCraft50 Posted January 14, 2017 Author Share Posted January 14, 2017 @jopcode Here's how to do it, this will select the child of the group that collided: //Select the child bullet from the group weapon, same in enemies game.physics.arcade.collide(weapon, enemies, function(bullet, enemy){bullet.kill(); enemy.kill();}); Link to comment Share on other sites More sharing options...
phreaknation Posted January 16, 2017 Share Posted January 16, 2017 why destroy the object? I would create a pool and just hide/move the object then when another bullet is fired call it again. That way you are not creating and destroying hundreds of bullets. Link to comment Share on other sites More sharing options...
Recommended Posts