#366·matter-js

collisionStart firing multiple times

Author: dxuCreated Feb 8, 2017Updated Nov 2, 2025
Labelsinvestigate

Hi! I wrote up a small plugin for adding collision events to bodies, but I'm looking to use this elsewhere, and I'm noticing that the 'collisionStart' event is being fired a lot of times compared what I would expect is a single collision between two boxes.

You can run the example included in the repo, but essentially I have two squares, BoxA and BoxB, falling onto the ground at different heights. I expected that there would be 3 collisionStart's (and 3 corresponding collisionEnd's), while there might be a bunch of collisionActive's:

  1. BoxA hits Ground
  2. BoxB hits BoxA (BoxB is above BoxA)
  3. BoxB falls over, hits Ground.

But instead I get something along the lines of 10-20 collisionStarts and Ends.

untitled

Is this intentional / expected? Am I doing something wrong?

Thanks for the great work you've done with this engine! It's really awesome, and I'm looking forward to playing with it further!