JuZDePeche
JuZDePeche

Reputation: 789

Matter js: is there a way for a group of bodies to collide with each other and for another group: the last group is acting like a sensor?

I would something like surviv.io : items on the ground (circles with weapon) collide with each other but for the players, items are only sensors. How can I do this?

I tried collisionFilter.category and mask, but the player is not detecting the circle body for an event.

enter image description here

Upvotes: 0

Views: 1839

Answers (1)

JuZDePeche
JuZDePeche

Reputation: 789

I asked the question on the Matter.js GitHub (https://github.com/liabru/matter-js/issues/691) and the creator suggest me to pin 2 bodies together (1 solid body and 1 sensor)

enter image description here

Upvotes: 1

Related Questions