// Start is called before the first frame update void Start() { health = maxHealth; if (gameObject.tag == "Player") { healthIndicator = GameObject.Find("UIHealth").GetComponent <UIHealth>(); } if (healthIndicator) { healthIndicator.setHealth(health); } }