question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

collisionStart firing multiple times

See original GitHub issue

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!

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
liabrucommented, Feb 18, 2017

Thanks for this, will check it out.

0reactions
liabrucommented, Feb 25, 2022

@gokadi can you check Matter.version is it 0.18.0?

If so can you try out the alpha build file included this PR? https://github.com/liabru/matter-js/pull/1079

Be great to know if it resolves, here’s the discussion on it https://github.com/liabru/matter-js/issues/1077

Read more comments on GitHub >

github_iconTop Results From Across the Web

matter.js: collisionStart triggered many times for one collision
I am trying to implement a system that adds points every time a bullet hits a target. In order to do this, I...
Read more >
Matter.js Physics Engine API Docs - brm.io
The Matter.Engine module contains methods for creating and manipulating engines. An engine is a controller that manages updating the simulation of the world ......
Read more >
Collision and Triggers | Learn PlayCanvas
This event fires once when a rigid body enters a trigger volume (where a ... with the surface all that time, no more...
Read more >
Alice 3 - How-to Guide (Part 4 - Events)
clicked, both sceneActivated listeners will “fire” simultaneously. ... To handle events that may occur multiple times, Alice provides a multiple.
Read more >
How to do a collision check only once, game maker studio ...
I want to have a second kind of bullet that fires from a certain tower ... them multiple times for the duration of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found