Character Controller Falls Through Box Collider Ground 1% Of The Time!

Background: Hey there! I’m working on a 2D platformer that utilizes 3D Box Colliders as terrain. Each scene has 5 or so intersecting box colliders that act as terrain. This was the easiest way for me to build out my scene, and actually gives me a high level of control.


Problem: I’m currently doing beta testing with a testing company, and they have mentioned that, very, very rarely, sometimes the character controller will fall through a walkway (box collider). I’ve had this happen on occasion as well, more so inside the editor than in a standalone build.

Any ideas as to why this is happening? I assure you, it’s not what you think:

  • It’s not suddenly becoming a trigger
  • It’s not disabling
  • It’s not destroying
  • Once the pass through occurs, the player will always pass through (if I grab the player and move him up and drop him. Even if I switch the collider on and off, enable and disable the trigger, etc.

This happens sometimes to my player, but also sometimes to enemies that also use the Character Controller component. It’s seemingly randomly.

It really is just not working. I think it might be a Unity glitch. I’ve had this happen only in Unity 5.

What I can say is the box colliders are not ticked as “Static”. Additionally, the colliders are all separate game objects, not multiple components on one game object.

Thanks!
Thomas

I once had to do a check with raycast from the rigidbodys last position to its current position to keep bullets from occasionally going through walls. Maybe not the most efficient way but it worked.