I just need a clearing on what im doing. Im going to have Heath on my Enemy and its going to take damage from my bullets and when health is <= 0. So far, i have an empty script i calld EnemyHeathScript, where i put
public class EnemyHealth : MonoBehaviour {
public int EnemyMaxHealth = 100;
public int EnemyCurHealth = 100;
Thats it so far. And on my bullet script i have
public class DestroyScript : MonoBehaviour {
public float lifetime = 1.0f;
void Start ()
{
}
void Update () {
}
void Awake ()
{
Destroy (gameObject,lifetime);
}
void OnTriggerEnter(Collider other)
{
if(other.gameObject.tag == "Enemy")
{
DestroyObject(other.gameObject);
Destroy(gameObject);
}
}
Not sure what to add on the bullet script and i want to know how to set up my EnemyHealthScrip so it takes damage. I know it isent that hard, but i want to be on the safe side!