- Home /
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");
}
}
Answer by $$anonymous$$ · Feb 15, 2013 at 12:37 AM
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.
Your answer
Follow this Question
Related Questions
The referenced script on this Behaviour is missing! on empty scene 6 Answers
[Solved] GUI Error? 1 Answer
Error: Optimized GUI Block text buffer 4 Answers
Problem| Unity3d start to crashing all the time 1 Answer
Game crashes! 1 Answer