I have a camera following the player through the loby oa the hotel room .when player goes near the wall and when i rotate the player the camera penarte through the wall . I tried wow camera script layer masking script none of the script is not working .How can we aviode camera penetrating through the wall .Is there any better solution for this problem.
This is quite a big field - camera occlusion - and there are lots of ways to do it. Even some of the A-List games have problems with this.
One of the best guides I found was : http://www.3dbuzz.com/vbforum/content.php?212
Go to : Section 3 - Enhanced Character and Camera Control
Start at : 11 - Occlusion and Collision Overview
Watch that and all the Theory video’s after that (12, 14, 16, 18).
That is just one method! You could attach a rigidbody and collider to the camera but I think that would be harder to control. Or raycast between the camera and the player, if it hits a collider then modify the material. Lots of management to do this way.
Watch the video’s then see what you think after that =]
EDIT : found new link as above is now 404 : http://www.3dbuzz.com/training/view/3rd-person-character-system