I have a parsing error in my short script, looked at other questions, can’t find what I need. Trying to make an exit game button. Here is my whole code…
function OnGUI()
{
if (GUI.Button(quitButtonRect, “Quit”))
{
Application.Quit();
}
}
any problems with my script? checked it many times and I can’t find the error. Making the game for a group project.
you need to format your code and include the error, its likely that the error is not on this line, you are probably missing a semicolon on a previous line
If that is your full code, then quitButtonRect
does not exist and you need to create it or specify a rectangle yourself. Please post your exact error(s) to narrow it down.