

Collision detection is at the heart of every physics-based game in Unity. If you don’t understand it, fast-moving objects may pass through walls, or physics may feel “off.”
Unity provides two main collision detection modes for Rigidbodies: Discrete and Continuous. Choosing the right one is essential for both performance and accuracy.
This is the default mode. Unity checks for collisions only at each physics update (FixedUpdate).
Example usage:
Rigidbody rb = GetComponent<Rigidbody>(); rb.collisionDetectionMode = CollisionDetectionMode.Discrete;
Use discrete for most objects that move at moderate speeds or are static most of the time.
Continuous mode tells Unity to predict movement between physics steps to catch collisions that might otherwise be missed.
Types of continuous collision detection:
Rigidbody rb = GetComponent<Rigidbody>(); rb.collisionDetectionMode = CollisionDetectionMode.Continuous;
| Mode | Use Case |
|---|---|
| Discrete | Most objects, slow-moving or static (e.g., crates, walls) |
| Continuous | Fast-moving objects that collide with static colliders (e.g., bullets) |
| Continuous Dynamic | Fast-moving objects that collide with other moving objects (e.g., racing cars) |
Rigidbody bulletRb = GetComponent<Rigidbody>(); bulletRb.collisionDetectionMode = CollisionDetectionMode.Continuous;
Without Continuous mode, the bullet might skip the wall entirely if it moves faster than the physics timestep allows.
Unnecessary. Only fast-moving objects need it. Overuse can hurt performance.
Even with continuous collision detection, extremely fast objects combined with high physics step intervals can still tunnel.
Ensure the fast object’s layer can collide with the target collider.
Understanding the difference between discrete and continuous collision detection is crucial for high-quality physics in Unity. Fast-moving objects, bullets, vehicles, or anything that could skip colliders must use continuous collision detection.
When combined with proper Rigidbody settings, Fixed Timestep, and good collider design, your game’s physics will be reliable and smooth, without tunneling artifacts.