Jump to content

Detect end of collision


Recommended Posts

Arcade physics collisions return true if the collision has occurred, and false if it hasn't.  You can use this to determine the first frame where the collision stops happening.  Something like this:


var collisionHappenedLastFrame;

if(game.physics.arcade.collide(entity1, entity2)){
   collisionHappenedLastFrame = true;
      collisionHappenedLastFrame = false;

      //here's your code that relies on the collision ending


Link to comment
Share on other sites


  • Recently Browsing   0 members

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