- Home /
Answer by AurimasBlazulionis · Nov 23, 2016 at 10:00 AM
You need to use coroutines. Assuming you write in c#, the code would look as follows
if(Input.GetKeyDown("e"))
{
StartCoroutine("Quit");
}
}
IEnumerator Quit () {
yield return new WaitForSeconds(5);
Application.Quit ();
}