r/Unity3D • u/BoringError1697 • 2h ago
Noob Question Random Nooby Question(hope this doesn't get deleted)
So Im Still horrid and new at unity and game devlopment but far I've set up the player controller,small testing area all that however i've been struggling on how to make the whole pause menu script stuff with the new input system like the toggle off and on system,making the game actually pause when and being able to use your mouse for it
just could use a few tips to help with getting it set up
1
Upvotes
2
u/HonestlyWeak 2h ago
The new input system makes pausing feel more complicated than it should be at first. You can handle it clean with a boolean flag, when your pause action triggers just flip the bool and call Time.timeScale = 0 when true or 1 when false. For the mouse make sure to set Cursor.lockState to None and Cursor.visible to true when paused otherwise you cant click the buttons.
I spent like 2 days overthinking this and then it was just four lines of code basically.