Files
CartoonFPS/Assets/Scripts/HealthPickup.cs
2025-08-05 17:31:28 +01:00

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);
}
}
}