I want my Unity game to start with Time.timeScale = 0f becuase it starts with a main menu that is in the same scene as the game. I tried to put Time.timeScale = 0f in Awake() but that did not work as expected. Putting it in Awake() paused it almost immediately but somehow the update funtions run at least once because some objects moved a little before the game paused. How do I pause it immediately when the game starts?
You can specify the setting on launch using the Time section of the project settings (Edit>Project Settings>Time).
Update function is not affected by timeScale (Though it affects all measured delta times in the Time class, except for fixedDeltaTime). So, you should build some logic to tackle this. On the start of the
Update body, add
if (Time.timeScale == 0f) return;. This will effectively prevent
Update from running while Time.timeScale is 0.
More info on Time.timeScale from the docs.