Crosshair help!!!

ok so I am trying to make it so when I aim my crosshair goes away but I cant quite get it here is my code

var crosshairTexture : Texture2D;
var position : Rect;
static var OriginalOn = true;

function Start()
{
    position = Rect((Screen.width - crosshairTexture.width) / 2, (Screen.height - crosshairTexture.height) /2, crosshairTexture.width, crosshairTexture.height);
}

function Update()
{
	if (Input.GetButton("Fire2"))
	{
		crosshairTexture == false;
	}

	else if (Input.GetButton("Fire2"))
	{
		crosshairTexture == true;
	}
}

function OnGUI()
{
    if(OriginalOn == true)

    {
        GUI.DrawTexture(position, crosshairTexture);
    }
}

please tell me what I need to fix. Thank You.

You’re assigning a boolean to crosshairTexture, but it’s declared as Texture2D! Just modify Update to toggle OriginalOne each time Fire2 is pressed - the rest of the code seems ok, including the position rect calculation.

function Update()
{
	if (Input.GetButtonDown("Fire2"))
	{ // toggle the variable OriginalOne:
		OriginalOne = !OriginalOne;
	}
}

NOTE: You don’t need to compare a boolean variable to true - just check the variable directly:

    if (OriginalOn){
        GUI.DrawTexture(...);
    }