So, here’s what I have so far, and I was wondering if it was possible to determine the Random.Range and call it as the variable damageDone in order to have it display as text above an enemies health. Not sure if possible or not
public int damageToGiveMin;
public int damageToGiveMax;
public GameObject damageBurst;
public Transform hitPoint;
public GameObject damageNumber;
private int damageDone;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter2D(Collider2D other)
{
if(other.gameObject.tag == "Enemy")
{
//Destroy(other.gameObject);
other.gameObject.GetComponent<EnemyHealthManager>().HurtEnemy(Random.Range(damageToGiveMin, damageToGiveMax));
Instantiate(damageBurst, hitPoint.position, hitPoint.rotation);
var clone = (GameObject) Instantiate(damageNumber, hitPoint.position, Quaternion.Euler(Vector3.zero));
clone.GetComponent<FloatingNumbers>().damageNumber = damageDone;
}
}
}