Box colliders sometimes don't work

So I have a level that consists of a bunch of box colliders lined up one after another. The player character then has to run over all of them. However, after changing the way I instantiate the gameobjects with the box colliders on them, I sometimes experience a problem where a box collider will stop working and the player will fall through it. This happens probably once in every 500 blocks or more, so it is fairly hard to reproduce, however when it does happen I cannot get the specific box collider to collide with the player no matter which settings I tweak. The only way to fix the problem has been to remove the box collider from the gameobject and add a new one.

Things I have tried already to no avail:

  • Adjusting the fixed timestep
  • Adding a kinematic rigidbody component

So my big question is, does anyone know what can be causing this?

Physics can be a little wonky sometimes… Have you tried this script?

I think I get the same problem. It happens to me with box colliders, convex mesh colliders and I think regular mesh colliders. It’s very rare, like you said, and when it happens, I can’t get the collider to work again no matter I try.

The fact that it’s only happens once in a while makes it very hard to diagnose. But I can say that I’ve seen it happen both in the editor and in release builds. Also it seems that certain game objects in the scene are more likely to have it happen than others, but I haven’t been able to establish any similarities between those objects.

Have you had any luck with the problem since making this post?

Edit: All the colliders I’ve seen stop working have been static.