private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Enemy") { healthbar.TakeDamage(playerController.damageTaken); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Weapon") { return; } if (collision.tag == "Player") { healthBar.TakeDamage(damage); } }