Player Health Texture | HELP

Hello unity. So basically im trying to switch my FPS player from numerical display of health, thirst, and hunger over to a texture for each as obviously thats more aesthetically appeasing.

Here is my code:

var healthTex:Texture2D;
var backgroundTex:Texture2D;
private var fpsPlayer:Component;

function Start() {
fpsPlayer = GetComponent("FPSPlayer");
}
function OnGUI() {
GUI.Texture(Rect(100,100, fpsPlayer.maximumHitPoints, 25),backgroundTex);

GUI.Texture(Rect(100,100, fpsPlayer.hitPoints / fpsPlayer.maximumHitPoints * fpsPlayer.maximumHitPoints, 25),backgroundTex);
}

Now i get this error message when i attach it to my player:

MissingMethodException: UnityEngine.GUI.Texture

Boo.Lang.Runtime.DynamicDispatching.MethodDispatcherFactory.ProduceExtensionDispatcher ()

Boo.Lang.Runtime.DynamicDispatching.MethodDispatcherFactory.Create ()

Boo.Lang.Runtime.RuntimeServices.DoCreateMethodDispatcher (System.Object target, System.Type targetType, System.String name, System.Object[] args)

Boo.Lang.Runtime.RuntimeServices.CreateMethodDispatcher (System.Object target, System.String name, System.Object[] args)

Boo.Lang.Runtime.RuntimeServices+<Invoke>c__AnonStorey14.<>m__7 ()

Boo.Lang.Runtime.DynamicDispatching.DispatcherCache.Get (Boo.Lang.Runtime.DynamicDispatching.DispatcherKey key, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)

Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)

Boo.Lang.Runtime.RuntimeServices.GetDispatcher (System.Object target, System.Object[] args, System.String cacheKeyName, Boo.Lang.Runtime.DynamicDispatching.DispatcherFactory factory)

Boo.Lang.Runtime.RuntimeServices.Invoke (System.Object target, System.String name, System.Object[] args)

UnityScript.Lang.UnityRuntimeServices.Invoke (System.Object target, System.String name, System.Object[] args, System.Type scriptBaseType)

GUI Health.OnGUI () (at Assets/GUI Health.js:9)

Any help is appreciated!

Try to use a GUI.DrawTexture(…);

~Erdroy

Or GUI.Label, or GUI.Box

Thank you! Also, is there a way to make these vertical? or do they have to be horizontal?

So using this method, is there a way to make it draw the portions of the texture or will it just stretch and shrink the texture? Im basically trying to have it fill a vial such as in Diablo 3 and 2, but the texture isnt a plain red you know, so it looks wierd when it starts to shrink when losing health.

Can you post a screenshot of what you mean exactly about filling the vial? Not so sure what you meant there.

As you can see, the health texture is on the bottom left and is represented by a standing man, and when you lose health, the inside red decreases but the textures form still is there, it doesnt shrink to compensate for the healths loss it just basically in laymans term removes that part of the texture for the time being.