Hello, I have a 2D mobile game, where I have a fast and small bullet Rigidbody2d object. Due to tunneling the bullets can fly through the wall staticbody2d. I enabled continuous collision detection, and it fixed it, but now the enemy kinematicbody2d won't detect the bullet entering it's area2d and the bullet will just bounce of of the enemy. So I disabled continuous collision detection on the bullet and increased the physics FPS to 240hz for the tunneling to stop, but now the mobile device can't handle it. What's the solution ?
Note: tunneling happens when you have a small and fast object. Due to its speed and size, it goes from at one frame being completely behind the wall to in the next frame being completely passed the wall, so the engine doesn't consider a collision to have happened.
When increasing the FPS the chance of the bullet colliding with the wall becomes bigger. Continuous collision detection (CCD) fixes the problem by using a raycast to detect if there was something between the two frames