How to fix unstable boolean values? [possible bug]

Hello,

I am creating an override boolean value for a game project I am working on. Only when the "t" key is pressed does this override activate (Input.GetKeyDown), and it is reversed upon lifting the "t" key (Input.GetKeyUp). The problem is that the value seems to be toggling elsewhere in the code. It is very bizarre!

This is where it is called:

if (Input.GetKeyDown("t")){
        objectTurret.GetComponent(turretOverlord).editModeGo(true);
}else if (Input.GetKeyUp("t")){
        objectTurret.GetComponent(turretOverlord).editModeGo(false);
}

**turretOverlord script functions**

    function editModeGo(isEditMode : boolean){
        editOverride=isEditMode;
        spinnerAccess.GetComponent(turretSpinShoot).setEdit(!editOverride);
    }

    function Update(){
        if (!editOverride){
            spinnerAccess.GetComponent(turretSpinShoot).setEdit(gamePlayer.GetComponent(playerMoveScript).editMode);
            // playerMoveScript.editMode is ALWAYS true for this particular problem
        }
    }

turretSpinShoot.

private var editMode : boolean = false;

function Update () {
    print (editMode);
}

function setEdit(modeOn : boolean){
    editMode=modeOn;
}

When I run this, the behavior changes each time I press/unpress "t": 1st time: "False", followed by an infinite stream of "True" 2nd time: a repeating stream of "False" then "True" then "True" 3rd time: a repeating stream of "False" then 4x "True" 4th time: a repeating stream of "False" then 6x "True" 5th time: a repeating stream of "False" then 8x "True"

What in the world could be causing this???!

If your "if input" stuff is actually outside a function, you'll want to move it inside a function (probably update).

Additional:

Perhaps the problem is that GetKey expects a KeyCode argument. Try replacing "t" with KeyCode.T