- Home /
Quit game button doesnt work,Button not quitting build game
Issue: I wanted to make a quit game button for my game, but for some reason it doesnt work
First of all my setup
This is the setup on the button
The MenuManager is a game object with this component attached to it
using System.Collections; using System.Collections.Generic; using UnityEngine; public class MainMenuManager : MonoBehaviour { public void OnExitGame() { Debug.Log(""); Application.Quit(); } }
It should in theory work, but for whatever reason it doesnt seem to work.
Here a few further infos:
-Yes im running this in build
-The Debug.Log is getting triggered when I run it in edit mode
-Yes there is a EventSystem in the scene
-No there is no overlapping ui
-The greying out of the button still works in build
-Application.Quit works (I added application.quit on a keypress and it worked, so the issue only apllies to the button)
-Any other button with this setup has the same issues,