MrSnrub Posted March 25, 2018 Share Posted March 25, 2018 Hi, Is there a way to use collision groups in phaser 3 for matter.js physics? I am trying to create a group of sprites that collide with the player but don't collide with themselves. Thank you Link to comment Share on other sites More sharing options...
MrSnrub Posted March 25, 2018 Author Share Posted March 25, 2018 Found out how to do this. For anyone that might be interested, if you have sprites with matter.js bodies and don't want them to collide, you can set sprite.body.collisionFilter.group = -1 to the ones you don't want colliding and they won't collide with each other but they will still collide with everything else. For more detailed info: http://www.iforce2d.net/b2dtut/collision-filtering Link to comment Share on other sites More sharing options...
PixelPicoSean Posted March 25, 2018 Share Posted March 25, 2018 Take a look at the collision filter example: http://labs.phaser.io/view.html?src=src\physics\matterjs\collision%20filter.js Link to comment Share on other sites More sharing options...
Recommended Posts