// Update is called once per frame void OnGUI() { //hScrollbarValue = GUI.HorizontalScrollbar (new Rect (25, 25, 100, 30), hScrollbarValue, 1.0f, 0.0f, 10.0f); float barWidth = 100; GUI.DrawTexture(new Rect(0, 0, barWidth, 28), HealthBackgroundFrame); float healthPercentage = m_playerEnt.GetCurrentHealth() - 4; Debug.Log(healthPercentage); GUI.DrawTexture(new Rect(2, 2, healthPercentage, 22), HealthForegroundFrame); }