This is way too overkill and overcomplicated. What you need is a GUITexture set up and a script with a link to this GUITexture, a public health variable, a function to damage it and script to handle health and an array of textures. What you can do to simplify is that divide your health with a number to get proportions, for example health%25 will give you back 0,1,2,3,4, which you can use to set the appropriate texture in the GUITexture.Texture = textures[dividedValue]; this way you got your gui update up and running in three line of code.
↧