- Home /
 
 
               Question by 
               IMTRIGGERHAPPY9 · Nov 05, 2011 at 03:47 PM · 
                guibuttontoggle  
              
 
              Is there a way of using just basic gui.Buttons as toggles?
I have this script here:
 if (GUI.Button (Rect (Screen.width - (Screen.width - 10),Screen.height - 70,60,60),"Monsters") || Input.GetKeyUp("v")){
         showMonsterButtons = true;
     
         }
 
               that i want the showMonsterButtons to be false when i click it again. how would i do this?
               Comment
              
 
               
               
               Best Answer 
              
 
              Answer by Catlard · Nov 05, 2011 at 03:49 PM
is this what you mean?
 if (GUI.Button (Rect (Screen.width - (Screen.width - 10),Screen.height - 70,6
 0,60),"Monsters") || Input.GetKeyUp("v")){
            if(showMonsterButtons) showMonsterButtons = false;
            else showMonsterButtons = true;
     
     
            }
 
              wow.... ha ha i wasn't even thinking along those lines! thank you for pointing it out! i feel like such a noob now ha ha ha
Your answer
 
             Follow this Question
Related Questions
Whats wrong with my GUI.Toggle? 2 Answers
Is there a better way to access the single active Toggle in a ToggleGroup? 4 Answers
GUI window popup button 1 Answer
Game Object Toggle GUI Button Errors 1 Answer
Toggling multiple button states 2 Answers