using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.UI; public class healthSlider : MonoBehaviour { private TMP_Text txt; public Slider slider; private void Update() { txt.text = $"{slider.value}/{slider.maxValue}"; } }