Object moves too fast for the collider to catch (solution for unity)

18 January, 2021

TL;DR

Don’t rely on colliders for fast-moving objects. Use Physics.Raycast to detect collisions reliably.

The Full Story

Let’s talk about how to actually handle this.

This problem usually shows up with bullets or similar high-speed objects—think arrows or anything else zipping across the screen. In most other cases, you can just set the Rigidbody's Collision Detection to Continuous, and that should be enough.

Object moves too fast for the collider to catch

The root of the issue lies in how collision detection works. It follows a lifecycle and doesn’t check for collisions every single frame. So if your GameObject is moving fast enough, it might slip right through another collider between those checks—essentially sneaking past without ever triggering a collision.

To fix this, you'll need a custom collision check. Your specific implementation may vary, but here’s a general approach that works:

  1. When the object starts moving, use a raycast to check if there are any interactable layers in its path.
  2. In each update (preferably in FixedUpdate for performance reasons), raycast again in case the target is moving.
  3. If you detect a hit, store the collision point.
  4. During every FixedUpdate, compare the current position of the object with that stored hit point.
  5. If the object has passed the hit point, trigger your collision logic.

With this method, it doesn’t matter how fast your "bullet" moves—it won't skip over anything important.

 


You might also be interested in the following posts:

Lately I finished the "Designing Games", by Tynan Sylvester, lead developer of Rimworld. Highly recommend to everyone who is interested in game design. This book is not about the code, but about experience that your game will create.