void OnTriggerExit(Collider coll) { if (coll.gameObject.tag == "Player") { StopCoroutine(refHM.DoDamageOTime(damageAmount, damageTotal, periodInSeconds)); } }
// bool isTakingDamage; void OnTriggerEnter(Collider coll) { if (coll.gameObject.tag == "Player") { refHM = coll.GetComponent <HealthManager> (); StartCoroutine(refHM.DoDamageOTime(damageAmount, damageTotal, periodInSeconds)); } }