void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.GetComponent <Attacker>()) { healthText.decreaseHealth(); Destroy(collision.gameObject, 1f); } }