- Home /
GUI.anything not working
I have a problem, that unity says, that " 'GUI' does not contain a definition for (for example)`Button' ". I have written the code in OnGUI, and even copy pasted some of the unity scripting references, but it doesn't work. bizarrly, the GUI stuff in my old projects is working just fine. Thanks in advance
This same question was asked in the forum today: http://forum.unity3d.com/threads/240361-GUI-skin-causes-error-Why
Answer by robertbu · Apr 13, 2014 at 06:01 PM
Typically this happens if you have named one of your scripts or classes 'GUI'. Your class then overrides the built-in GUI class. The solution is to rename your script/class to something other than GUI.
As robertbu said, if it's working in other projects fine then it is almost definitely a project issue. Remove assets from your project until you find what is causing the conflict