Game dev
Saved & recent

Tunneling

Related terms: continuous collision detection, CCD

Physics moves objects in steps. A fast object can be in front of a thin wall on one step and behind it on the next, without ever overlapping it. It passes straight through.

Continuous collision detection checks the whole path swept between two steps. It costs more, so it is switched on only for small fast things. Other fixes: thicker walls, smaller steps, or a raycast in place of a physical bullet.

Further reading
Godot: Troubleshooting physics issues
step 1 step 2 discrete steps first contact continuous sweep
Checking the two endpoints misses the wall. Sweeping the interval finds contact when the leading edge of the marble reaches the wall.

View in the full Game dev collection