private void Update() { currentHP = bar.GetHP(); currentRed = bar.GetRed(); currentBlue = bar.GetBlue(); currentGreen = bar.GetGreen(); currentYellow = bar.GetYellow(); if (currentHP <= 0 && FindObjectOfType <TurnManager>().initializing == false) { defeated = true; GetComponentInChildren <MeshRenderer>().material = defeatedMat; } }