- Home /
Gui.Button An argument is missing. ((Rest Of Code Works Fine Expt for this one Line.))
Hi, I'm trying to set a code that Turns on and off other buttons, Howerver seems to be an error on a single line, Gui bot that declairs "Exit" of my submition of Unlocking a character.
// ***************END OF START FUNCTION PROCEDE TO GUI BUTTONS AND UNLOCK VERIFACATION ONLINE DATABASE**************
void OnGUI() {
float LeftMenuX = -250;
float RightMenuX = 250;
//Character 1 Purchase character and send information to database.
// ********************** Checked if Character1 has not been set to 0 *************************
if(GUI.Button (new Rect(490,200,180,120), "Unlock")); //replace Text with GuiImage
{
hasMyFirstButtonBeenPressed = true;
}
//if you have clicked on the button it gives you the option to purchace or to quit.
if (hasMyFirstButtonBeenPressed)
{
GUI.Box(new Rect(90,330,320,200), "Please Enter Your Username To Confirm Purchase");
//USERNAME INPUT FOR SECURITY AND IF PLAYER MAKES A MISTAKE.
// ******Please Enter Your Username To Varafy Unlocking******
GUI.Box(new Rect(18,50,900,10), "Please Enter Your Username To Confirm Purchase");
formcharacter1 = GUI.TextField ( new Rect( (Screen.width /2f)-(((100)*(Screen.height/5))/100)+LeftMenuX
,((300)*(Screen.height/5))/100 //y
,((200)*(Screen.height/5))/100 //width
,25f ) //height
, formcharacter1);
//Update My Character Purchace.
if(GUI.Button ( new Rect( (Screen.width /2f)-(((100)*(Screen.height/5))/100)+LeftMenuX ,((375)*(Screen.height/5))/100 , 316*0.58f ,75*0.58f) , "Unlock" ) //connect button
) {
cashTest (); // performs Void of cashtest, checks to see is user has enough Gold REquired for Purchase.
}
// Draw a button to exit the purchase
if(GUI.Button ( new Rect(95,370,100,20,), "Exit"))
{
hasMyFirstButtonBeenPressed = false;
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613184017im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
What is NullReferenceException :Object reference not set to an instance of an object? 1 Answer
SyncList TO 3 Answers
Tilemap loading 1 Answer
Character Rotation - Script not functioning correctly 1 Answer
Same script execution order issue 1 Answer