- Home /
GUI does not contain a definition for `skin' ?
I get this error. " GUI' does not contain a definition for
skin'". But i have used this function many times why does it say that gui doesnot contain skin now!? I don't get it!
This is where i get the error:
GUI.skin = skin;
(skin is a public GUISkin variable assigned using the inspector)
Comment
Are you sure this is the GUI class in UnityEngine namespace? Try with UnityEngine.GUI.skin. it should exist.
Yeah i did. I feel like an idiot! :P Thanks a lot, such a silly mistake.
Best Answer
Answer by robertbu · Aug 07, 2014 at 05:35 PM
Typically this problems is because you named your own script GUI and the compiler is looking inside your class for 'skin' rather than Unity's GUI class. If so, rename your script/class.