Pause menu scripting help?

Hi, i need help with the below script, with the GetButtonUp( script, how can you programme it so that you can input any button into it to be able to pause it?? (i would like to press the “P” button for it to work)

Thanks in advance.

var paused : boolean = false;

function Update () {

if(Input.GetButtonUp(“Jump”)){

if(!paused){

Time.timeScale = 0;

paused=true;

}else{

Time.timeScale = 1;

paused=false;

}

}

}

You are simply using the wrong function. Just use

Input.GetKeyUp("p")

, instead that

Input.GetButtonUp("Jump")

So, your final script would be:

var paused : boolean = false;

function Update () {

   if(Input.GetKeyUp("p")){

      if(!paused){

         Time.timeScale = 0;

         paused=true;

      }else{

         Time.timeScale = 1;

         paused=false;

      }

   }

}