Quick answer: Discrete collision detection runs only once per fixed step. Fast objects skip past thin colliders between steps. Set the moving Rigidbody’s Collision Detection to Continuous Dynamic, lower fixed timestep slightly, and consider raycast-based hit detection for ultra-fast projectiles like bullets.
Here is how to fix Unity Rigidbody objects that pass right through walls when moving fast. Bullets clip the floor. Players moving 30 m/s phase through gates. The cause is a fundamental limitation of discrete collision detection: it only checks overlap at fixed-step boundaries, so fast objects can be on one side this step and the other side next step without the engine ever noticing they crossed a barrier.
The Symptom
A projectile or fast Rigidbody passes through a static collider as if nothing was there. OnCollisionEnter never fires. The wall is solid for slower objects. The thinner the wall (or the faster the object), the more likely the tunnel.
What Causes This
Discrete collision is per-step. Default detection mode samples positions at each FixedUpdate and checks for overlap. If the bullet was 1m left of the wall last step and 1m right of the wall this step, no overlap was sampled.
Thin colliders. A wall 0.05m thick fails collision detection at speeds where the per-step movement exceeds the wall thickness.
Long fixed timestep. Default 0.02s (50Hz physics) gives a 30 m/s object 0.6m per step. Walls thinner than 0.6m can be missed.
Bullet collision detection wrong. Setting Continuous Dynamic on the wall and Discrete on the bullet does nothing — the moving object needs the upgrade, not the static one.
The Fix
Step 1: Set Collision Detection to Continuous Dynamic on the moving Rigidbody.
using UnityEngine;
[RequireComponent(typeof(Rigidbody))]
public class Bullet : MonoBehaviour
{
[SerializeField] private float speed = 50f;
void Awake()
{
var rb = GetComponent<Rigidbody>();
rb.collisionDetectionMode = CollisionDetectionMode.ContinuousDynamic;
rb.interpolation = RigidbodyInterpolation.Interpolate;
rb.linearVelocity = transform.forward * speed;
}
}
Continuous Dynamic does a sweep-test along the path between fixed steps, catching collisions discrete mode would miss.
Step 2: Lower the fixed timestep. Open Edit → Project Settings → Time. Change Fixed Timestep from 0.02 to 0.01 (100Hz). Each step covers half the distance, halving the tunneling chance. Costs roughly 2x physics CPU.
Step 3: Use raycast-based hit detection for very fast projectiles.
public class RaycastBullet : MonoBehaviour
{
[SerializeField] private float speed = 200f;
private Vector3 lastPos;
void Start() { lastPos = transform.position; }
void Update()
{
Vector3 newPos = lastPos + transform.forward * speed * Time.deltaTime;
Vector3 dir = newPos - lastPos;
if (Physics.Raycast(lastPos, dir.normalized, out RaycastHit hit, dir.magnitude))
{
HandleHit(hit);
Destroy(gameObject);
}
else
{
transform.position = newPos;
lastPos = newPos;
}
}
}
For bullets and lasers, raycast is more reliable than physics and avoids the entire tunneling category.
Step 4: Thicken thin colliders. If a wall is meant to look thin but block fast objects, add an extra invisible collider with more depth behind it. Or set the wall’s collider Inflate Convex on a Mesh Collider to bulk it out.
Step 5: Avoid teleporting Rigidbodies via transform.position. Direct transform writes bypass physics and can cause objects to start a frame already inside a wall, where Continuous Dynamic cannot help. Use Rigidbody.MovePosition for kinematic teleports.
Performance Tradeoffs
Continuous Dynamic costs more CPU per Rigidbody than Discrete. Apply it only to the objects that need it: bullets, fast vehicles, falling debris. Slow-moving objects (NPCs, pickups) should stay on Discrete to save physics budget.
Verifying The Fix
Set physics.queriesHitBackfaces = true in code to see hits even on rear faces. Add a debug ray that draws the bullet’s path between frames; if the path crosses a collider but no hit is logged, your detection mode is still wrong.
“Discrete checks endpoints. Continuous checks the path. Fast objects need to check the path.”
Related Issues
For Rigidbody falling through floor, see Rigidbody Falling Through Floor. For mesh collider issues, see Mesh Collider Convex Required.
Continuous Dynamic on the moving body. Lower fixed step. Raycast for bullets. Walls become solid again.