Inspired by the code bullet I wanted to make a hill climb racing game and so like him, I'm using the p5.js engine but unlike him, I'm going to use matter.js as my physics. Ive finished creating the terrain using perlin noise. And am now creating the car. I don't want to use the matter.js car because there doesn't seem like there is any collision is there so plan b is to create 2 circles that are our wheels that are constraind with each other. Also create a car body that's constraint to the wheel. Now in this I also want it to be so that there is collision between the wheels and the ground and the car body and the ground but not the body and the wheel because I want to use suspension in my car. So my question is how do I make it so that the ground can collide with the car body and wheel but the car body and wheel don't collide with themselves. I've been trying this with many failed attempts with this being the latest https://github.com/KidCoderT/hill-climb-racing and I don't understand why it happens. Ive created 3 different masks.
let worldCategory = 0x0002,
carBodyCategory = 0x0003,
carWheelCategory = 0x0004;
and applied them separately to each item yet they all collide with each other what am I doing wrong. Please help me thank you