Character colliders seem to have problems when passing under objects. At times, I have to add a vertical clearance of almost 0.5m (0.5 units in unity) in order to get my character to pass through the doorway of a house. The house uses a mesh collider.
The clearance I have to add also seems to be inconsistent; sometimes it’s less with some meshes it’s more. If I use a floating cube, it’s not as bad but I still need to put around 0.3m of clearance else my characters cannot pass through.
What are the guidelines for this?
Have you tried to make the character collider smaller?
Are you sure that the “Capsule” of the character collider surrounds the mesh you have?
The capsule collider is correct.
After using a re-exported world mesh the problem went away.
Just a some general (untested) conjectures if anybody has the same problem:
The problem seemed to be that the initial FBX file was imported with a corridor that was too small and had some additional rescaling done.
We corrected the corridor inside Unity, but the Capsule collider of the CharacterController refused to enter the corridor, even though visually there was a lot of space for the collider to pass through.
Then we corrected the corridor before importing into Unity, as well as normalized the scaling factors. Tthe Capsule collider then functioned correctly.
I no longer have the older mesh, but I would hazard that it was a combination of the import scaling factor in conjunction with us doing a translate on the mesh collider inside Unity that gave the corridor mesh an incorrect transform somewhere.
For all you TL;DRs, if your world’s mesh colliders seem to be acting strangely, try fixing transforms in the art package first before importing into Unity. 