I need help with collision for my camera controller

I am making a spiritual successor and or parody of MGS1. My camera controller is very simplistic in that it just offsets the position of the player above and a little behind with the rotation placed in the editor, not the script. what I want to happen is that when it comes in contact with the wall it pans down looking at the player not to go through the wall.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class camOffSet : MonoBehaviour
{
    public Transform cam;    
    public Vector3 offSet;    
    private void LateUpdate()
    {
        transform.position = cam.position + offSet; 
    }
}

I have no idea what to do and everything I try to look up is for other third-person things like MGSv or Fortnite not the sorta top-down style of MGS1

Hello.

You need to add colliders to the walls and to the camera. Add a Rigidbody to one of the objects that need to be detected (or all walls or the camera)
Then use code to detect the collisions and activate some script that moves the camera.

I let you some links. You have work! :smiley:

Bye!