Third person camera and Object

Hi all. i have a question for my rpg game.

If i use Third person camera, and the charater are example in wall.

The player can see behind wall.

how can I avoid that the camera does not pass through the wall?

Use collision detection. You’ll raycast back from the player. If the raycast hits something (like a wall), you need to move the camera in front of the point of collision.

Some examples already exist on the Unity wiki:

http://wiki.unity3d.com/index.php/Scripts/Controllers

http://wiki.unity3d.com/index.php/SmoothFollowWithCameraBumper

Here’s 3DBuzz’s comprehensive tutorial:

http://www.3dbuzz.com/forum/threads/186940-Unity-Creating-a-Custom-3rd-Person-Character-System-Drop-ONE

http://www.3dbuzz.com/forum/threads/186955-Unity-Creating-a-Custom-3rd-Person-Character-System-Drop-TWO

http://www.3dbuzz.com/forum/threads/186970-Unity-Creating-a-Custom-3rd-Person-Character-System-Drop-THREE

http://www.3dbuzz.com/forum/threads/187133-Unity-Creating-a-Custom-3rd-Person-Character-System-Drop-FOUR