[SOLVED] Ammo.js not returning collision callbacks

BTW, enabling the CCD doesn’t solve the problem with collision detection completely. Just imagine we have a fast moving body (like bullet) with moves towards a wall. When bullet’s speed becomes really high, it can go through the wall and therefore no ‘collisionstart’ event is fired. After enabling CCD on the bullet, it starts colliding the wall properly, but I still don’t see any ‘collisionstart’ events fired :frowning:

The same happens when FPS drops below 15-20 and the distance traveled by the bullet per frame is big enough. Bodies collide but without firing any events.

1 Like

That indeed sounds like a bug or a Bullet system not implemented in Ammo.js/Playcanvas.

As a temporary solution, if performance allows it, I would try doing a raycast per frame and check the distance threshold to invoke manually a collision event.

1 Like

I would agree. For bullets, I’d use raycasts!

Out of curiosity, @Igor, are you using the ‘legacy’ physics, or does your project have the new WebAssembly based version of ammo.js?

Yeah, raycasting could be a solution, pretty rough though. Thanks guys!

To @will: we faced the bug in both legacy and WebAssembly builds.

1 Like

2 posts were split to a new topic: Not getting collision callbacks with physics