Unable to play Death Animation. Parameters missing?

I am trying to play a Death Animation using the Animator. I select my animation and the preview works. But when i go into the game, I get an error saying —“The animation state deathAnimation could not be played because it couldn’t be found!
Please attach an animation clip with the name ‘deathAnimation’ or call this function only for existing animations.”— I tried changing it to legacy and the error goes away but the amination is never played when enmeyHealth reaches 0.
So I think that my probles lies in creating a new parameter that checks if “isDead” inside the Animator in order to play the deathAnimation. However, I have problems coming up with a logic or the syntax to do so. Can anyone please help? Here is the code I am using:

var Health = 100;
var animDie : AnimationClip; // Drag your animation from the project view in here (to inspector)
var isDead = false;

function Update () {
if(Health <= 0 && isDead == true){
//this.gameObject.GetComponent.().Play(“deathAnimation”);
Dead();
}
}

function ApplyDamage (TheDamage : int){
Health -= TheDamage;
}

function Dead(){
GetComponent.().Play(animDie.name);
//GetComponent.().Play(“deathAnimation”);
Destroy(this.gameObject, animDie.length);
}

Well first of all I think your variable isDead should be a boolean. Booleans have two states: true or false. Just like how ints and floats differ. Next I dont see any code where your variable isDead is set to true? This makes it so isDead is always false and your if statement never plays:

if(Health <= 0 && isDead == true){
 //this.gameObject.GetComponent.<Animation>().Play("deathAnimation");
     Dead();
 }

I dont know if I am correct but hopefully this helps. Cheers!