Jump to content

Remove Collision from Group


ManBoy
 Share

Recommended Posts

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.

Link to comment
Share on other sites

I wrote enemy.body.destroy()

 

This error came out:

 

  1. Uncaught TypeError: Cannot read property 'scale' of null phaser.min.js:12
    1. c.Physics.Arcade.Body.postUpdatephaser.min.js:12
    2. c.Sprite.postUpdatephaser.min.js:7
    3. c.World.postUpdatephaser.min.js:5
    4. c.Game.updatephaser.min.js:5
    5. c.RequestAnimationFrame.updateRAFphaser.min.js:8
    6. window.requestAnimationFrame._onLoopphaser.min.js:8
    7.  
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...