So, I’ve been building the main menu, setting up the new UI and such, and I’ve hit a snag. The exit button on the menu opens up the standard ‘do you want to quit? y/n’ and supposedly when I click yes it should run the following:
public void ExitGame()
I’d appreciate any tips in regards to debugging.
Add a call to
Debug.Log inside your
ExitGame function to make sure it’s being called.
Also, are you running the editor? Application.Quit doesn’t function there.
To test this functionality out, you must build you game first.
Go to file-> build settings
- Click on Add current if you haven’t added the scene you are debugging
- Pick the PC, Mac, & Linux Standalone option under Platform
- Click Build And Run
After all those steps have been followed, you should be able to see if quitting the game works.