//^^gör att man dör om man vidrör syran public void Hurt(int dmg) { HP -= dmg; Debug.Log($"took {dmg} damage. You now have {HP} HP left"); if (HP <= 0) { SceneManagement.Death(); } }
private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.CompareTag("Ground") || collision.gameObject.CompareTag("AlsoGround")) { isJumping = false; } if (collision.gameObject.CompareTag("DeathZone")) { SceneManagement.Death(); } }