Gate Question

Created a script for when the player presses F, the objects will go down, problem is it’s not working. Do you think you could tell me what’s wrong with my script?

// Makes gate go down
var smooth = 2.0;
var DoorOpenAngle = 90.0;
var DoorCloseAngle = 0.0;
var open : boolean;
var enter : boolean;
//Main function
function Update (){
if(open == true){
	var target = animation.Play ("Lever1");
}
if(enter == true){
	if(Input.GetKeyDown("f")){
		open = !open;
		}
	}
}
//Activate the Main function when player is near the lever
function OnTriggerEnter (other : Collider){
Debug.Log("Trigger is on");
if (other.gameObject.tag == "Player") {
	Debug.Log("I am here ");
		(enter) = true;
	}
}
//Deactivate the Main function when player is go away from lever
function OnTriggerExit (other : Collider){
if (other.gameObject.tag == "Player") {
	Debug.Log("Trigger is on");
	Debug.Log("I am here ");
		(enter) = false;
	}
}

Try setting open to false in your top loop. It could be an issue with the animation.Play() getting called repeatedly.

Something like this maybe:

if(open == true){
    var target = animation.Play ("Lever1");
}