I am trying to get the 1st person controller walking in the room created by Maya.
I applied meash collider onto the room, so when the 1st person controller collides with the wall of the room, it stays at the same place and can’t go forward. I got two problems here:
Is there any way I can adjust the distance of the colliding radius? (not by changing hte radius of 1st person controller because there are different objects in the scene needing different distance to FP)?
After 1st person collide with the wall (very close to the wall), it can see outside of the room when turning. How to prevent it?
The cause for this problem is a bad combination of skinny character with wide view angle: click the First Person Controller and observe in the Scene view how the near clip plane corners extend a little outside the character capsule.
The best solution is to increase the character radius to 0.5 or 0.6 - find the value that makes the near clip plane be kept inside the character collider (the green wireframe! the white capsule doesn’t follow the character radius).
NOTE: Before some bad ideas come to your mind: don’t try to solve this problem by reducing the camera field of view or near plane distance! A reduced field of view will “zoom-in” the camera, and a near plane distance below 0.30 (default) will drive you crazy with an awfull problem known as “Z-fight” .
Compound Colliders (see the docs) allow you to build the room out of a bunch of Box colliders, and tweak the collision-area of each wall.
For a modelled room, you’d pick one wall, create an Empty game object, add a BoxCollider component, child it to the room, and shape to the wall. This is where you can make the wall count as a little thicker. Copy/Paste that child and resphape for each wall/floor.