Unity Pause Button Script

Well I have this pause button script I want to use, when i hit the key P. But when I rearrange the code to have it use the key P, it says Input Key P is not setup. what is going on?

Here is the code unchange

// Toggles the time scale between 1 and 0.7
// whenever the user hits the Fire1 button.
function Update () {
if (Input.GetButtonDown (“Fire1”)) {
if (Time.timeScale == 1.0) {
Time.timeScale = 0.7;
}
else {
Time.timeScale = 1.0;
}
// Adjust fixed delta time according to timescale
// The fixed delta time will now be 0.02 frames per real-time second
Time.fixedDeltaTime = 0.02 * Time.timeScale;
}
}

Try a lowercase p maybe?

How do you use the “P” key?

You should either setup an item in the Input Manager and add “P” as the positive button (recommended), since users will be able to change that key through the input setup.

Or use the Input.GetKey(KeyCode.P).

But you can’t use Input.GetButton(“P”) if it’s not defined.