camera detecting walls

Hi there. I have a camera with a boxCollider that is there to detect walls, but every time I hit a wall my 3rd person controller just stop in its track.

How can I my make the camera move inwards or move out of the way every time I get close to a wall. I have tried using ray casting and Mathf.Lerp but I don’t know if I am doing the Right thing. I just starting to get a good sense of using java script but I’m not the best scriptwriter.

If anyone can help me out, I’ll deeply appreciate it.

When I use a third person camera, I have a script which checks for a blocked view. The script runs a raycast from the player to the camera, if it hits anything I move the camera in.