Physics never saw them inside the wall.

The problem
A fast body, checked at stops.
void Fire(){ Rigidbody b = Instantiate( bullet, muzzle.position, muzzle.rotation ); b.AddForce( muzzle.forward * 400f, ForceMode.Impulse );}
Physics checks the bullet 50 times a second. At 400 m/s it moves 8 m between checks.
The fix
Check the path, not just the stops.
Continuous collision sweeps the body along its path between steps, so a thin wall is still found.
Discrete→checks the stops
Continuous→checks the path
The fix in code
Only on the fast ones.
void Awake(){ var rb = GetComponent<Rigidbody>(); rb.collisionDetectionMode = CollisionDetectionMode.Continuous;}
It costs more, so set it on bullets, not on every crate.
Watch out
Hitting things that move?
Continuous is for fast bodies against still walls. Moving targets need Continuous too.
- Fast vs still walls
- Continuous
- Fast vs moving
- ContinuousDynamic
- Instant hits
- a raycast
The rule
Small and fast? Make it continuous.
- Bullets, fast balls
- Continuous
- Everything else
- Discrete
- Instant hits
- Raycast