private void OnTriggerEnter2D(Collider2D other) { Debug.Log("LOL"); if (other.transform.CompareTag("Player")) { //assuming there is only one player: player.AdjustHealth(-3); } }
public void Consume(GameObject player) { HealthManagement hm = player.GetComponentInChildren <HealthManagement>(); hm.AdjustHealth(potency); }