← Back to development blog

Unity3D Android Back Button Best Practice

May 23, 2016 · Unity3D Game Development

Google has done extensive analysis and focus group research on Android user behavior. One important issue that Google research has identified for Android developers is to always have a listener for the Back button. In Unity3D simply add the following code into your loop:

if (Input.GetKeyUp("escape")) {
    // Quit application
    Application.Quit();
}

For modern Unity projects, Input.GetKeyUp(KeyCode.Escape) is a convenient alternative.

← More articles