Problem With Opening Door

Hello,
I have a problem of opening the Door,
i do not what the problem since Unity gives me no error.
when i put the animation to play Automatically it shows but when i put the Script it does not work, this is my Code:

var target : Transform;
var area: int = 5;
function Update () 
{
var hit : RaycastHit;

	if (Physics.Raycast(transform.position, transform.forward, hit, area))
	{
	if (hit.collider.gameObject.tag == "Gate")
	{
	hit.collider.gameObject.animation.Play ("O");
	print ("Ray Cast On");
	}
	}
}

the picture is also attached,
what is the problem here??

My quick guess would be: you’re triggering animation on the box01/02 on on the Gate object. Can you try playing animation on Gate object?