Input.GetKeyDown(KeyCode.Escape) work but continues to exit the app and restart…any solution?
Unfortunately that’s too vague for us to be of help. What do you mean by “work”, and what do you mean by “continues to exit the app and restart”? Specifics of what happens are important.
Also, are you in the Editor or a build?
I mean i’m build in android device… my problem I want to stop the app from closing when pressing the return/back button (next to home button)… then I use the Input.GetKeyDown(KeyCode.Escape) runing in a script in update I add the debug.log in the update then after tapping I can see the log from Input.GetKeyDown(KeyCode.Escape) but the app continues to exit and completely quit/exit… then reopening the app will restart it… my only goal that the app must not restart if use accidentally press back button or home button… I’m using unity 2018.3.8f1 building in windows 10
The reason it’s restarting is that the app crashes with Application.Quit() which I assume you are using . I haven’t found a solution to this
this is solve… sorry my mistake… I found the script was causing the problem