Switching camera code not working

I have a code to switch cameras when you press the arrow left, it takes you to camera 2, and when you press the right again, it takes you to camera 1.

it doesn’t work when you press the right arrow? why??

var Camera1 : GameObject;
var Camera2 : GameObject;

function Start(){
	Camera1.active = true;
 	Camera2.active = false;
}

function Update(){
	  if ( Input.GetKey(KeyCode.LeftArrow)){
	Camera1.active = false;
	Camera2.active = true;
	   if ( Input.GetKey(KeyCode.RightArrow)){
	  Camera1.active = true;
 	  Camera2.active = false;
		}
	}
}

Try

Camera1.gameObject.active = true;

Do

Camera1.SetActive(true);

And so on

Turns Out Unity Didn’t like The Actual number 1 in the variable, so i had to do it like “CameraOne”

Doh

var Camera1 : GameObject;
var Camera2 : GameObject;
var CamSwitch = false;

function Update()
{
	if(Input.GetKey(KeyCode.LeftArrow))
	{
		CamSwitch = true;
	}
	if(Input.GetKey(KeyCode.RightArrow))
	{
		CamSwitch = false;
	}
	if(CamSwitch  == true)
	{
		Camera1.SetActive(false);
		Camera2.SetActive(true);
	}
	if(CamSwitch == false)
	{
		Camera1.SetActive(true);
		Camera2.SetActive(false);
	}

}