Example #1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == "HealthDrop")
        {
            // Debug.Log("Health picked up");
            Destroy(collision.gameObject);
            healthBar.AddHeart();

            if (health < 50)
            {
                health += 10;
            }
        }
    }