using UnityEngine; using UnityEngine.UI; public class PlayerUI : MonoBehaviour { public Text healthText; public GameManager gm; // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() { // todo: automatically find game manager } // Update is called once per frame void Update() { healthText.text = gm.currentHealth.ToString(); } }