Thats My Script and when i kiil my enemy its not playing the animation !
_______________________________________________________________________________________________
#pragma strict
var Health = 100;
var animDie : AnimationClip; // Drag your animation from the project view in here (to inspector)
function ApplyDammage (TheDammage : int)
{
Health -= TheDammage;
if(Health <= 0)
{
Dead();
}
}
function Dead()
{
GetComponent.().Play(animDie.name);
Destroy(this.gameObject, animDie.length);
}
↧