play a door animation with collider

so i have to 2 scripts that seem like they should work to me but since i have like no experience with scripting it may be completely wrong. i have a door that i animated to be like a slamming door. attached to that object i have this

var closeAnimationString : String;

function React()
{
	animation.Play(closeAnimationString);
}

now i have a box collider with this this script

function OnTriggerEnter(hit : Collider)
{
	if(hit.gameObject.name == "door slam trigger")
	{
		gameObject.Find("girls door").SendMessage("React");
	}
}

i get no errors but nothing happens when i enter this box. am i doing something way wrong? or is there a simpler way to do this?

In the code above, the box collider expects that an object named “door slam trigger” enters it. If the box collider is the “door slam trigger” object, you must instead compare the hit.name to the name of the object that enters it - supposing that the player is the “First Person Controller”, do it like this:

function OnTriggerEnter(hit : Collider)
{
    if(hit.gameObject.name == "First Person Controller")
    {
       gameObject.Find("girls door").SendMessage("React");
    }
}