I am working on a large 3rd person game project in Unity. We started in 2.6 and everything was working great. When we upgraded to Unity 3.3, we started to have an issue where the player, at seemly random times would just fall through the world. The funny thing is that when this happened, not only the player would fall through but other NPCs (with Character Controllers on them) would do the same at the exact same time.
When running in the editor, I would pause, raise the player and other NPCs above the terrain and hit play again. The player (and other NPCs) would then just keep falling, right through the terrain (both Unity terrain and externally modeled objects with mesh colliders.) If I manually put a cube or plane below the character with the standard colliders it stops as it should. It is almost as if Physics/colliders completely broken between the character controller and the terrain (or externally modeled terrain with mesh colliders) in the game.
I read some other posts that said you should delete the character controller and re-add it after upgrading to Unity 3. I did this but the problem still persists.
To be clear, the player works fine 95% of the time. The other 5% it just falls through the world (as described above.) Unfortunately we have burned 40 hours trying to diagnose and solve this problem. I am 99% certain that the issue is with Unity itself and not our setup or code.
We need to resolve this ASAP as we need to release the game. Any help would be greatly appreciated.
UPDATE: The problem seems to happen more often when we delete game objects with colliders on them. For example, we delete arrows that have been shot after a period of time. Deleting these colliders seems like it may be causing holes in the terrain mesh collider. Very strange...
I think this has to do with the slope limit.
When something collides with the Controller capsule, the capsule thinks it is another platform.
I fixed this problem in my game by adding tags to the things I didn't want the Player to treat as a slope.
If the player collides with any of them, I set the Slope limit to 180 degrees, else I set it back to the original value in the script.
When I have terrain beneath my Character Controller capsule and it bumps into a sphere above it, it momentarily seems to ignore the fact that it is still colliding with a target below it.
I've fixed my problem where my CharacterController was falling through the terrain by adding to the OnControllerColliderHit function in PlatformerController.
Without seeing the source code relating to CharacterController I can't tell what exactly is going on, however this solution works in my case. If it is deemed not to be useful comment, then I will surely remove the posts.
I have a similar problem where, if I do something to one object (say add a collider, but no rigidbody) collision detects breaks for everything. No errors show up in the console window, nothing. If I revert the change, all of the sudden, everything starts working again. Right now I'm fighting with trees.. as soon as I add a capsule collider to my tree pre-fab, everything breaks. Remove it, and it's fine.
Sorry I can't help with an answer, but this definitely seems like an issue with Unity. Even if I'm/we're doing something wrong to one object, it should not:
There must be something causing a singularity in the physics calculations or something.