Change Camera on (Right) Mouse Click

Hello, I need help on this one. I’m trying to make a TPS. One of the basic features is if you hold RMB, the camera is switched to another camera. Now, I’m very bad at coding so I’ll need your help. Would you kindly…?

Could this code be useful?

public Camera camera1;
public Camera camera2;
    
void Update(){
    if (Input.GetMouseButtonDown(1)){ 
         camera1.gameObject.active = false;
         camera2.gameObject.active = true;
    } else 
    {
         camera1.gameObject.active = true;
         camera2.gameObject.active = false;
    }
}

Then you just have to assign camera1 and camera2 in the inspector on the object you assign this script on.

Update please