Time.timeScale = 0

i have a pause menu the uses Time.timeScale = 0 but i cant use any of the scripts inside the pause menu this way please help.

Answers are all over the show on this one. It would certainly help get a coherent answer if you posted a specific script that was not running.

Setting Time.timeScale to 0 will stop the following from running

  • FixedUpdate
  • Anything that relies on Time.deltaTime
  • Coroutines once they hit a WaitForSeconds

There are several simple ways to run code while in paused mode

  • Any code that is in update and doesn’t use Time.deltaTime will continue to run
  • Use Time.unscaledDeltaTime for time based functions that are independent of timescale
  • Use custom timers to control any coroutines that need to keep running

Setting timeScale to a very small number works, I’ve seen it suggested in several places on Unity Answers. However I don’t like the idea and suggest you avoid it. It has the potential for unintended side effects as your game is still running when you expect it to be paused.

Put Your Code OnGUI void not in Update or FixedUpdate or LateUpdate as these voids freezes