15 lines
362 B
C#
15 lines
362 B
C#
using UnityEngine;
|
|
|
|
public class HealthPickup : MonoBehaviour
|
|
{
|
|
public float healAmount = 25f; // Amount of health to restore when picked up
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
if (other.CompareTag("Player"))
|
|
{
|
|
PlayerHealthController.instance.Heal(healAmount);
|
|
Destroy(gameObject);
|
|
}
|
|
}
|
|
}
|