|
well i was going through unity forums and saw the button script. i made a decent looking and working main menu... exept for the button doesnt work. so i thought the button script might work with my level changing script. // JavaScript function OnGUI () { // Make a background box GUI.Box (Rect (10,10,100,90), "Loader Menu"); } so i copied it and then i thought id try to change it up to where it would work with it. but i cant even get anything to show up when i use it, theres no compiler errors, but it doesnt work. why? // JavaScript function OnGUI () { if (GUI.Button (Rect (10,10,150,100), "I am a button")) { print ("You clicked the button!"); } }
(comments are locked)
|

@felix420,
Your post (as it appears now) probably isn't appropriate for UnityAnswers. The UnityAnswers philosophy is:
"[Unity Answers] is a place to ask specific questions that have specific answers. The forum is a better place to post discussions and non-technical questions."
As a general rule, posts should probably have the following:
If your post is one of the following, you should consider changing it or asking on the forums instead:
Finally, make sure that you check to make sure your question hasn't already been answered here, and do a quick google search, before posting a new question.
Of course, the members here are awesome folks and will probably try to help you anyway - hopefully you'll get an answer or some helpful comments. If not, now you know why.
Yes, we need more detail, what is not working? Any errors?
Your problem is probably the z depth of your buttons on the GUI ... Is your GUI.Box being rendered, but no buttons? If so, try GUI.depth, and reorder your drawn elements so that . Alternatively, it could be a problem with positioning (your buttons may be being drawn off the screen, in which case you would use Screen.width and Screen.height to account for different screen sizes).
Without more information, there's no way we can know for sure.
you might of forgotten to attach the script to something within your scene.