Question by
Eddie21uk · Jun 10, 2017 at 08:02 PM ·
animationscripting problem
I cant get my animator to play when injuried or dead. please help
How do i get the animation to work in parallel with the action please? getting injured and playing an injured animation? getting killed and playing the death animation?
thanks in advance
public void addDamage(float damage){ if (damage <= 0)return; myAnim.SetTrigger ("damage"); currentHealth -= damage;
if (currentHealth <= 0)
{
makeDead ();
}
}
public void makeDead(){
Instantiate (death, transform.position, transform.rotation);
myAnim.SetTrigger("death");
Destroy (gameObject);
}
//**IEnumerator DeathSequence() // { // myAnim.SetTrigger("death"); // yield return new WaitForSeconds(3f); // Destroy (gameObject); // }
Comment