Using the same controller button twice

I’m so close with this I can taste it. I think.

I’m using a camera switch script:

var camera1 : Camera;
 
var camera2 : Camera;
 
 
 
 
function Start () {
 
camera1.camera.active = true;
 
camera2.camera.active = false;
 
 
}
 
 
function Update () {
 
if(Input.GetButtonDown("Inventory")){
 
camera1.camera.active = false;
 
camera2.camera.active = true;
 
 
}
 
 
 
if(Input.GetKeyDown("l")) {
 
 
camera2.camera.active = false;
 
camera1.camera.active = true;
 
 
}
 
 
}

What I’d like to do is use the same button to enable and disable it. (essentially I’m using it to switch between my main camera, and a menu) Right now “Inventory” takes you into it, but “l” takes you out. Reason being, if I assign both to “Inventory” then nothing happens. Now, I suspect that all that’s needed is a simple “if” statement, such as:

if({camera2.camera.active = true;)

but being so new, I’m not sure if that’s

A: Correct, or
B: Where I should put it anyway.

Each effort has resulted in errors so far, parse, unexpected token, etc. If someone might be kind enough to help me figure this out, I’d be grateful. God bless.

public Camera camera1;

        public Camera camera2;
         
        bool camera1ActiveBool;
         
         
        void Start () {
         
        camera1.camera.active = true;
         
        camera2.camera.active = false;
         
        camera1ActiveBool = true;
        }
         
         
        function Update () {
         
        //use whatever button you want to toggle
        if(Input.GetKeyDown("l")) {
         
    if (camera1ActiveBool == true)
    {
    camera1.camera.active = false;
    camera2.camera.active = true;

camera1ActiveBool = false;
    }
    
    else if (camera1ActiveBool == false)
    {
    camera1.camera.active = true;
    camera2.camera.active = false;

camera1ActiveBool = true;
    }
          
        } 
        }

camera.active = !camera.active;