- Home /
How do i have a pause after i resume game C# 6.4
I have got a fully functioning pause menu working where i can press the escape key and the game un pauses, and if i press it again of if i press the resume button on the menu the game resumes, but the problem is that, for some reason as soon as you resume the game from the pause menu, the player ( 2d platformer ) jumps up as if the jump key was pressed. I dont know how im going to solve it, so any ideas? I thought i might be able to add a delay in, maybe a 3 second count donw just before the game restarts, which might stop the wierd ug/ glitch i am having. Thank you any help would be good :D
Can you show your code, or at least some of it so we can see what you're checking for and where.
EDIT
No, what I meant was what buttons and clicks are you checking for. Also for pausing a game you can just use
Time.timeScale = 0; // to pause
// and
Time.timeScale = 1; // to un-pause
And as you can see from the above try and use the 101010 button for code, makes it a lot more readable. You can also edit your question which stops lots of comments. Don't worry I'm not telling you off just letting you know good ways to give others the best chance of helping you.
Okay sorry, my code for the pausing of the button is here: IEnumerator WaitAndPrint(float waitTime) { yield return new WaitForSeconds(waitTime); print("WaitAndPrint " + Time.time); }
And the character i have, is always floating and when u press the screen or click the up key, the character jumps. But when i upause the game, another jump happens after the game is unpaused?
Your answer
Follow this Question
Related Questions
Pause Game When Function Is Enabled? 3 Answers
Stop force from being applied during pausescreen 1 Answer
Pause game while GUI instructions displayed? 1 Answer
Couldn't resume once Time.timeScale is set to 0 1 Answer
Distribute terrain in zones 3 Answers