How to make 2 separate meshes collide with third mesh but not with each other?

I am developing a game where I need sphere meshes to collide with a specific mesh but not collide with each other (they should be able to go through one another).
Is this possible with layerMasks or can I exclude collision meshes or am I doing anything wrong with setting up PhysicsImpostors?
Thank you in advance <3

P.S. I am using CannonJS as my physics engine

Hello! I took a look at the engines and it doesn’t seem to be possible in the current ones, but I’ll tag @Cedric to confirm (he’s OOF for :christmas_tree: so it will be a bit before answering). It is possible to do it using the built-in collision system, by using collisionMask and collisionGroup: Collision groups and masks | Babylon.js Playground (babylonjs.com)

3 Likes

Collision mask is possible with Ammo, not Cannon.
Here is a quick example on how to set it:

3 Likes