Boolean won't toggle

Here’s the deal: I’m sending out a raycast from the player , and when against a certain collider with a certain key input i want it to trigger an animation and toggle a boolean.If it’s true then play animation 1 and toggle to false, and if it’s false, play animation 2 and toggle to true.
My problem is that the boolean stays false, and the whole event behaves as if it were always true.Here’s my code attached to the player.
#pragma strict

var watereye : GameObject;
var eyewelldown    : boolean;


function Start () 
{

watereye   = gameObject.FindWithTag("eyewater");
}

function Update () 
{

if (Input.GetButtonDown("action"))

	{
	var forward = transform.TransformDirection(Vector3.forward);
	var hit : RaycastHit;
	if (Physics.Raycast(transform.position,forward,hit,2))
	
		{							
		if(hit.collider.gameObject.tag == "eyewellcollider" && eyewelldown==false)				
			{
			watereye.animation.Play("eyewaterdown");
			eyewelldown = true;
			}
			
		if(hit.collider.gameObject.tag == "eyewellcollider" && eyewelldown==true)				
			{
			watereye.animation.Play("eyewaterup");
			eyewelldown = false;
			}
								
		}	
	}
}

Any help would be greatly appreciated, thanks.

I believe your problem is that you call the raycast every update and regardless of what the current state is, it will flip to the opposite. It will flip EVERY UPDATE. This is very often, so naturally your code behaves strange. I believe adding a yield (as long as the animation) before changing the bools value would fix this.