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?