- Home /
Can you pause unity playmode while mouse button is down?
I'm currently experiencing a bug where if I have the left or right click mouse button down, Ctrl+shift+p will not pause Unity's playmode. I'm trying to debug a situation where I am dragging UI objects. How can I get the pause hotkey to work properly with mouse buttons down?
Answer by mikemvpi · Dec 19, 2012 at 10:37 PM
Try using Debug.Break(); in your code. See answer from user Blah on this question.
Answer by CodeMasterMike · Dec 19, 2012 at 11:15 AM
Set the Time.timeScale variable to 0 (zero), that will pause everything that are frame rate independent. Remember, if you lower timeScale it is recommended to also lower Time.fixedDeltaTime by the same amount.
To return to normal speed, set the Time.timeScale to 1.
Read more in the timeScale documentation.
If you are working in editor view, the you can use the Debug.Break function as well to pause your game.
Read more in the Debug.Break documentation.
Good luck!
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Mouse Orbit Pause Menu problem 1 Answer
pause game 2 Answers
Problem in unity or just my computer? 0 Answers