Ok here is my health script that I’m working on for my monster. I want it to play the dying animation once life hits 0. Then around a minute or so the body should dissapear. Any help would be nice and I would like to have the destroy game object public for me test out.
using UnityEngine;
using System.Collections;
public class AiDamageC : MonoBehaviour {
public float MaxHealth = 100;
public float CurrentHealth = 0;
void Start () {
CurrentHealth = MaxHealth;
}
void ApplyDamage ( float Damage) {
if( CurrentHealth <= 0) {
animation.Play("dying");
return ;
}
CurrentHealth -= Damage;
if( CurrentHealth <= 0){
Destroy(gameObject );
}
}
}