I'm currently working on a basic car game using cannon.js and I've hit a roadblock.
The Goal:
My objective is to detect collision between the car and another object (such as a sphere) without applying any physical forces to either object.
For instance, I want to update the score or trigger certain events upon collision, but I don't want the objects to interact physically.
What I Have Tried Unsuccessfully:
I attempted to use the following:
chassisBody.addEventListener("collide",function(e){ "mycode"};
in conjunction with grouping like this:
var GROUP1 = 1; etc..
However, I believe the purpose of groups is to specify which objects should collide or not, but in my case I need them to "collide" without causing any physical impact, only to register that they intersected so I can implement scoring logic, etc.
(I included the threejs tag just in case someone who works with it might find this helpful since it's part of my project)
EDIT 2022:
If you're curious, here's how the code looked back then, though be warned, it's an outdated version :)