Animation triggered by an animation?

Hey, I’m working on a simple first person horror game. I have a house with stairs and upstairs area. I want Slender1 to go up the stairs on the box collider and trigger Slender2 animation.Please help I’m new to scripting and I have no idea what I’m doing lol.

var triggerAnim : boolean;

function OnTriggerEnter (other : Collider){
if(GameObject.FindWithTag(“nameofobject”){
triggerAnim = true;
}
}

function OnTriggerExit (other : Collider){
if(GameObject.FindWithTag(“nameofobject”){
triggerAnim = false;
}
}

function Update (){
if(triggerAnim){
Animation.Play(“nameofanimation”);
}
}