Closed notleeandrew closed 8 years ago
void Update () {
if (Input.GetKeyDown(KeyCode.P)) {
if (Time.timeScale == 1) {
Time.timeScale = 0;
} else {
Time.timeScale = 1;
}
this is how i did a pause function to the game
I tried this out and it seems to work though you may want to clarify what to put this code on for future reference (an empty gameObject).
My two stars
My wish If you could show how to work the UI after pausing the game e.g.
pause game -> opens menu -> can select to continue player, restart at last checkpoint etc.
This would help out a lot should anybody want to make a more elaborate pause menu.
When I press "P" I want time to stop and all inputs to be rendered moot so that nothing will happen