You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I create a Matter physics object, and add a collision event listener, the collision event gets fired for EVERY collision in the world, instead of just the one object that I added the listener to.
this.physicsBox = Matter.Bodies.rectangle(x, y, w, h, options)
Matter.Composite.add(world, this.physicsBox)
this.physicsBox.onCollide((pair) => {
console.log('Box got hit!', pair.bodyA.label, pair.bodyB.label) // this logs every collision in the world, even if this box is not part of it.
});
The text was updated successfully, but these errors were encountered:
If I create a Matter physics object, and add a collision event listener, the collision event gets fired for EVERY collision in the world, instead of just the one object that I added the listener to.
The text was updated successfully, but these errors were encountered: