ManBoy Posted March 12, 2014 Share Posted March 12, 2014 Hi, is it possible to disable collision from a certain sprite in a group? What I want to do is to make a 'dead' sprite to be uncollidable. However, I don't want to kill it immediately, so it can play its 'death' animation for several seconds before actually killing it. I don't want to kill the sprite and add another sprite in place of it just to play its death animation, is there a way? I tried enemiesGroup.remove(enemy), but it doesn't work, it still collides. darcys22 1 Link to comment Share on other sites More sharing options...
rich Posted March 12, 2014 Share Posted March 12, 2014 Destroy just the Sprites body, then it won't process any collision any more. Link to comment Share on other sites More sharing options...
ManBoy Posted March 12, 2014 Author Share Posted March 12, 2014 I wrote enemy.body.destroy() This error came out: Uncaught TypeError: Cannot read property 'scale' of null phaser.min.js:12 c.Physics.Arcade.Body.postUpdatephaser.min.js:12 c.Sprite.postUpdatephaser.min.js:7 c.World.postUpdatephaser.min.js:5 c.Game.updatephaser.min.js:5 c.RequestAnimationFrame.updateRAFphaser.min.js:8 window.requestAnimationFrame._onLoopphaser.min.js:8 Link to comment Share on other sites More sharing options...
rich Posted March 12, 2014 Share Posted March 12, 2014 It needs to be nulled on the Sprite as well, or the sprite will think it's still alive and try to read from it. Link to comment Share on other sites More sharing options...
ManBoy Posted March 12, 2014 Author Share Posted March 12, 2014 It works, thanks Link to comment Share on other sites More sharing options...
Recommended Posts