using UnityEngine; public class HealItem : MonoBehaviour { [SerializeField] private int healAmount = 1; private void OnTriggerEnter(Collider other) { if (!other.TryGetComponent(out Health health)) { return; } health.Heal(healAmount); Destroy(gameObject); } }