|
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...
(comments are locked)
|
|
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. That seems completely unrelated. Are you saying that without such action, your characters fall through or penetrates those objects? If so, can you explain how slope limit effects it? If not, could you please delete this answer. Hopefully it is the former and we are onto a solution. My understanding is that slope limit either stops objects (too steep) or lifts them (up slope). Never does it make objects non-collide.
Nov 10 '11 at 09:57 AM
Waz
(comments are locked)
|
|
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.
(comments are locked)
|
|
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. My "fix" was to use less colliders, and perhaps adding the collider to your tree prefab means you have a lot of colliders. Still definitely a bug in Unity of course (if it was at least numerically documented and gave an error/warning they could call it a limitation).
Jan 10 '12 at 12:09 AM
Waz
(comments are locked)
|

You may have to use the bug reporter. Go to help ~> report a bug (which is right at the bottom)
I've found Unity to have numerous issues with mesh colliders. In most cases I find using box and other simpler colliders tends to solve the problem. But in most cases this is not feasible :(
I've been experiencing a similar problem. I'm developing a game in my notebook, and when the frame rate falls to a ridiculous level (3 fps or less) something strange happens. First, some coins - simple objects with spherical colliders - start to be "taken" by the player - but the player is stopped far from them, and it should only happen if an object named "player" entered their colliders. A few seconds later, the player itself falls through the ground.
It's not an experience directly related to Unity and its colliders, but I've seen this same behavior before. In my case, it was a simple terrain mesh and some characters and NPC would just fall through, seemingly randomly. The culprit was a 2 vertex "triangle". I'm not sure why exactly, but the code we were using didn't like it.
I'm not sure if Unity collision works even remotely similar, but its worth taking a look at your mesh(s) for lines and ngons.
I'm getting a very similar problem - especially the infrequency of it (things that collided fine suddenly do not), and I hide and show (via GameObject.active).
Interestingly though, all my colliders are primitives - mainly BoxCollider.