Skip to content

Instantly share code, notes, and snippets.

@Gojeflone
Created February 17, 2014 02:53
Show Gist options
  • Save Gojeflone/9043900 to your computer and use it in GitHub Desktop.
Save Gojeflone/9043900 to your computer and use it in GitHub Desktop.
Pause the game by using Time.Scale
var paused : boolean = false;
function Update () {
if(Input.GetButtonUp("Jump")){
if(!paused){
Time.timeScale = 0;
paused=true;
}else{
Time.timeScale = 1;
paused=false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment