- Home /
Question by
starbusker · Feb 23, 2012 at 03:38 PM ·
animationdamage
Enemy don`t play dead!
//i put this script on my enemy behaviour... but animation don`t play "dead"... what`s wrong???? my enemy take the damage from prefab "bullet" //
var health=3;
function TakeDamage(damage:int)
{
health --;
if(health <- 0)
{
Die();
}
}
function Die () {
animation.Play("dead");
yield WaitForSeconds(2);
Destroy(gameObject);
}
Comment
Your answer
Follow this Question
Related Questions
Why won't my animation play? 1 Answer
Can the animation editor create local rotational data? 3 Answers
Adding animation clips via script 2 Answers
Damage Animation doesn't play 1 Answer
animation play the first time and then does not play again 0 Answers