
You should however detect when the Game is paused and resumed. You should not detect when the Home Button is pressed in order to do something. Player press the home button we could do saving the game ? If it pause the application / game could we detect it first when the You can't depend on the OS to handle this. This depends on many factors such as how long the app has been suspended, how many apps are open and the memory available on the device. Sometimes, the assets are unloaded by Android. What I can tell you is that the app is suspended for a while on Android. You did not mention which OS (Android or iOS) but you can research what happens when the home button is pressed for each one. So in unity when home button pressed at device mobile what will unity Please give the detail for me to find the solution.Īny help would be amazing for continue the game :) Or any idea from your experience what will do if player press home button ? This is for the player to not lose the game data.
#Quit game button unity code
If it pause the application / game could we detect it first when the player press the home button we could do saving the game ? ( i mean run a code after the button home is pressed ) What can we do in unity if the player press the home button ?

So in unity when home button pressed at device mobile what will unity do ? It is pause the application / game or whatever ? If the player restart the device the game that run in background will not saved to local or cloud. When someone or player press the home button which on device mobile the game will exit and run in background. I make a button exit when pressed the game is saved and then exit.īut i have a problem in here saved game.


I have code a save local and save cloud for the game.
