using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class IncreaseHealth : MonoBehaviour
    {

    void OnCollisionEnter(Collision col)
    {
        if (col.gameObject.name == "Player")
        {
            PlayerController p = col.gameObject.GetComponent<PlayerController>();
            p.currentHp = p.currentHp + 1;
            if (p.currentHp > p.hp)
                {
                p.currentHp = p.hp;
                }
            Destroy(col.gameObject);
        }
    }

}
