hey guys i want to end my game if i push in a button(game object), all i want is that when the button(game object) is pushed, that the game closes.
what i have is:
function start
{
if (input.getkeydown("j"));
application.quit;
}
but it doesnt work, what am i doing wrong??
A number of things are wrong:
-
There is no built-function called “start”.
-
The “Start” function only runs once anyway.
-
There is nothing called “application.quit”.
-
If statements do not have semicolons after them. Semicolons are for ending a statement.
4b) Formatting code correctly will help you see errors like that…the Application.Quit() line should at least be indented, and preferably enclosed in braces, though that’s optional with single lines.