Bala20kumar Posted October 30, 2017 Share Posted October 30, 2017 if (bodyA === null) { return; } if(equation[0].bodyA.parent.sprite.key!=='hit') { equation[0].bodyA.parent.sprite.key.body.destroy(); } if(equation[0].bodyB.parent.sprite.key!=='hit') { equation[0].bodyB.parent.sprite.key.body.destroy(); } anyone help to destroy the body... i got error on destroy line or here how can set safeDestroy as true Link to comment Share on other sites More sharing options...
gauravD Posted November 6, 2017 Share Posted November 6, 2017 Try this.game.physics.p2.removeBodyNextStep( equation[0].bodyA ); and this.game.physics.p2.removeBodyNextStep( equation[0].bodyB ); Link to comment Share on other sites More sharing options...
Recommended Posts