x


Strange errors with GUI.skin

Hi i was making a GUI script, and stumbled upon an error. Due to little programming experience i have no idea how to solve this:

MissingFieldException: Field 'GUI.skin' not found. Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.FindExtension (IEnumerable`1 candidates) Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.Create (SetOrGet gos) Boo.Lang.Runtime.DynamicDispatching.PropertyDispatcherFactory.CreateSetter () Boo.Lang.Runtime.RuntimeServices.DoCreatePropSetDispatcher (System.Object target, System.Type type, System.String name, System.Object value) Boo.Lang.Runtime.RuntimeServices.CreatePropSetDispatcher (System.Object target, System.String name, System.Object value) Boo.Lang.Runtime.RuntimeServices+c_AnonStorey16.<>m_C () 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.SetProperty (System.Object target, System.String name, System.Object value) GUI.OnGUI () (at Assets/Scripts/Player/GUI.js:8)

This is the script:

var GUIskin:GUISkin;
var healthMeter:Texture2D[];
var secondaryResourceMeter:Texture2D[];

function OnGUI(){
    GUI.skin = GUIskin;
    if(healthMeter.Length == 10){
       GUI.Label(Rect(10, 10, Screen.width / 2 - 5, 50), healthMeter[10 - 1], ScaleMode.ScaleToFit, true, 0);
    }else{
       Debug.LogError("More health Textures are needed, GUI");
    }

}
more ▼

asked Feb 29 '12 at 09:11 PM

MOH13 gravatar image

MOH13
1 1 1

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

MissingFieldException: Field 'GUI.skin' not found means that the engine cannot find the variable or method "skin" inside of class "GUI" this is probably because you named jour java script "GUI" and the engine is trying to acces it instead of the default GUI class. to fix it try renaming your script to something else.

more ▼

answered Feb 15 at 12:37 AM

Ben Jarrell gravatar image

Ben Jarrell
448 2 4

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3682
x1949
x591
x532
x4

asked: Feb 29 '12 at 09:11 PM

Seen: 447 times

Last Updated: Feb 15 at 12:37 AM