- Home /
Question by
AngryCSharpNerd · Mar 30, 2013 at 02:49 AM ·
guibuttonboxappear
GUI box not appearing when button is clicked
Really simple help, not sure why this can't work at all:
if(GUI.Button(new Rect(Screen.width-200,Screen.height-320,150,100), "Options")){
GUI.Box(new Rect(Screen.width/2-250,Screen.height/2-250,500,500),"ur momma",GUI.skin.GetStyle("StartMenuBox"));
}
The GUI box line does work when I take it out of the 'if' statement, but the box won't appear when I click the options button.
Comment
Answer by robertbu · Mar 30, 2013 at 04:29 AM
GUI.Button() only returns true for a single frame, so the box is only displayed for a single frame. You can solve the problem by using GUI.RepeateButton().
Your answer
Follow this Question
Related Questions
Remove GUI Box Drawing? 1 Answer
Problems with simple dialogue 0 Answers
GUI.Button on MouseHover 1 Answer