If your camera passes trough walls/tunels

So you got your camera and all setup to follow a Mesh or a Player but you find out that when your mesh is in a tunel and turns, the camera passes to the outside of the tunel, back and forward.

All you need to do is set the Camera as a No Sleeping Static/Dynamic Actor and adjust the Radius to your needs. If the Radius is bigger than the tunel the camera can just go above or under the tunel. Also don’t forget to play with the Damp and the RotDamp if your camera is moving around too much in the tunel or building and set the Bounds to Box or any other more convenient shape.

This is a problem that tortured me for quite long so I hope this can be helpful to new blenderers like me.

Its not perfect so any other way that anybody knows to prevent camera that follow an object to Cross it or other objects please I would be very glad to learn.

The overall best method I have found, and the one I’m pretty sure msot commercial games use, is to cast a ray from a point inside or very close to the character, to the camera’s farthest away position. If the ray intersects and object, place the camera slightly closer to the character than the intersection position. If no intersection, place the camera at its furthest position. As long as the script updates every frame then the camera will move in toward the character as needed. Every other frame might do, but then if the player moves fast enough they’d get to see through walls for a split second.

Here is a tutorial I read ages ago on setting up a 3rd person camera rig