Script Help

Hey everyone,
just a small problem, been searching for why this isnt working. I want the object to play its animations when the object is clicked.
I have this, but it doesnt play when i click it, not sure where to go with this?

#pragma strict


function OnTriggerEnter(theObject : Collider){
    if(theObject.gameObject.name=="3rd Person Controller") {
       animation.Play("Take001");
    }
}

function OnMouseDown () {
    animation.Play("Take001");
}

The first thing i would check is like @kolban said, check if your OnMouseDown function is being called. OnMouseDown needs a collider attached to the object or it can’t detect any raycasts (OnMouseDown is just based on a raycast).

If it is called then make sure the animation works and you don’t have another script that also plays a different animation which overrides this one.