I have a character and a camera behind him, also what this camera is looking at is what the game player is looking at. I tried “smoothfollow” script, but when the character is very close to a building and turns around, the following camera is then inside of the building, and loses the sight of the character (there is a wall between the character and the camera). So if there is a way to detect whether something is between the character and the following camera, I can adjust the position of the camera and avoid above situation.
We use something alike in Lies and Seductions (zooming closer if a wall is between the camera and PC). You can get the source and take a look ( http://mlab.taik.fi/~plankosk/blog/?p=308, CameraController.cs)