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!

