Animation for die is not playing just enemy is destroying y ? Given below script is attached to enemy when player shoots and health becomes 0 enemy should play die animation.but its not
function ApplyDemage(demage :int)
{
animation.CrossFade(“die”);
if(health==0)
{
animation.CrossFade(“die”);
Destroy(gameObject,2);
}
else
{
health -= demage;
}
}