- Home /
Pause button issue
My issue I don't believe is directly linked to my code, when I press Play to test what I'm doing so far there is no issue, however a new issue has arised where when I use my button input to jump (space) it now pauses the game, it's never done this before and I don't believe I've done anything to cause this, I've also tried changing the input button to see if this makes a difference (Which it didn't), if anybody can help me out that will be most appreciated.
Thanks
When this happens, does the pause button in the editor activate as if you clicked it, or does the game simply hang? If it's the latter, something hooked to your spacebar likely has an error which halts execution. Show us any code linked to your spacebar.
void Jump() {
if(Input.Get$$anonymous$$eyDown($$anonymous$$eyCode.Space))
{
audio.PlayOneShot(JumpSound);
rigidbody2D.AddForce(new Vector2(0, jumpSpeed));
anim.Play("Jumping");
}
The game pauses and if I click the pause button again it continues
Do you receive an error or warning in the console when this function executes? Do all three lines in the if-statement execute as expected? (apart from pausing the game, of course)
Nope no warnings or error messages, everything works fine, and I only just added the audio part but this problem was occurring before I put that in anyway, I think it's to do with a similar problem when in games, if you don't have the game "selected" as it were and say were to press W to walk and then Enter to do an action, if the Desktop was selected ins$$anonymous$$d of the game you would open up a program beginning with W, if you understand what I mean?
Well, the spacebar shouldn't pause the game, even when the editor is selected. The game or editor losing focus does pause the game, but that's unrelated to the spacebar. Posting your question, hope someone can help.
Answer by jrpaoliello · Mar 02, 2016 at 06:44 AM
Hello, I solved that. In the button pause properties (Inspector), the property Navigation need to be "none".
I have the same issue, but here is the thing: what the hell are pause properties and where do I find them? If I go to my object that I want to add a jump, I have on my inspector "Transform", "$$anonymous$$esh filter", "$$anonymous$$esh Renderer", "Box Collider", and the Scipts I added, no word of a "button" called "pause Properties"
Your answer

Follow this Question
Related Questions
(JS) Touch pause menu issue 1 Answer
Score wont stop after game is paused 3 Answers
How can i pause gradually from timeScale 1.0 to 0.0 over a second? 1 Answer
How do I pause and unpause multi gameobjects in the scene for a five seconds 1 Answer
Pause the video in unity after playing it but it will done automatically after some time of period. 0 Answers