Physics randomly not working

Hello,

I have the weirdest problem, and after searching for it for two days, I give up and hope someone here has an idea what is going wrong.

In the screenshot, we have the player character, with a character controller attached to it, standing on a box collider.

After a random period of time, the character suddenly falls through the floor. We have a trigger 4 meters beneath it that places the character back on the top of the stairs. If I walk back to the floor, the character drops through some parts of the box collider. That’s the weird part: through some parts, if I walk straight or to the left of the stairs I fall through the floor, on the right I can sometimes still walk on the floor. In the editor the box collider clearly is enabled.

This happens easily in the webplayer, and sometimes in the editor, but it’s harder to reproduce.

If I reload the scene the physics works again normal, until a random period of time.

In the editor, if I disable and enable the physics object or if I change a property in the inspector, the collider starts working again.

There are other box colliders in the scene, they show the same behaviour, sometimes. Most often it’s only the floor downstairs.

When the character walks on one of the round disks on the floor, the character is parented to the rotating disk, starts doing dance animations (it’s a disco) and the character controller is temporarily disabled. When the player stops dancing it’s placed back in the root, character controller re-enabled. The problem occurs most often when the player stops dancing.

But it also happens when the character doesn’t do any dancing, and just stands on the floor for a while.

I have many other scenes, where I run around with the same character, but the physics issue never occurs in the other scenes.

I have the impression that it happens easier when the framerate is higher.

The character controller is moved with the Move function.

If someone has an idea to how I could solve this, I’m breaking my head on this.

Thanks,
Alex

Additional info: the problem does not occur at 30 fps, but does at 60 fps…

This seems related to this issue: Character collider / physics bug in Unity 3.3 - falling through terrain / objects - Questions & Answers - Unity Discussions

We managed to avoid the problem in our case: There were 4 capsule colliders in the scene with the trigger flag enabled that were rotated every frame. Remove these and the problem did not occur anymore.