How do I get my animated Object to switch animations on Collider?

Hey guys, I`m a little new to coding and I have been working on a animated character model “Paladin” in Unity 5. The thing is, I want him to switch animations when the model hits a physics collider. I made a code here in JavaScript but even when he hits the collider he wont play the new animation :frowning:

`
#pragma strict
var Character : GameObject ;
function Start () {

}

function Update () {

}
function OnTriggerEnter (other : Collider) {
if(other.gameObject.tag ==“Paladin”){
GetComponent.().Play(“walking paladin”);
}
}
`

Here is how the code looks in Monodevelop just in case it is hard to read the code from the post :slight_smile: