# 7. Menu and Settings Pitfalls Part of [[Menus, Pause and Settings Flow]]. Prev: [[6. Worked Example Menu to Gameplay Round Trip]]. > [!warning] Code not compiled > The fixes below refer to scripts that have not been compiled in Unity. | Symptom | Cause | Fix | |---|---|---| | Title screen is frozen after **Quit to Menu** | `Time.timeScale` stayed 0 | `SceneLoader.Load` resets `timeScale` and `AudioListener.pause`; `PauseController.OnDisable` resumes | | Esc **pauses and unpauses** in one press, or closes two screens | `Global/Pause` and `UI/Cancel` both bound to Esc, handled by two scripts | One `Update` reads both and decides once ([[4. Pause Menu Time Scale and Audio]]) | | Esc that cancels a rebind also leaves Settings | Same key, two meanings | `SettingsScreenController.BlocksBack` guard | | Enter on **Resume** makes the player jump | Gameplay map still enabled for that frame | Disable the `Player` map on pause, re-enable on resume | | First frame shows wrong resolution / volume blares at launch | Settings applied in the title scene, too late | Apply in `Boot` before loading the title ([[6. Worked Example Menu to Gameplay Round Trip]]) | | Volume slider does nothing | Mixer parameter not exposed or renamed; `SetFloat` returns `false` | `SettingsApplier` logs the missing name; check the mixer's Exposed Parameters list | | Volume set at startup is ignored | Calling `AudioMixer.SetFloat` in `Awake` (community-reported, see hub open questions) | Apply in `Start` | | Snapshots stop affecting music volume | The 6000.5 docs: after `SetFloat`, snapshots no longer control that parameter | Use separate groups/params for the user volume and for snapshots, or `ClearFloat` (see [[5. Audio Mixer Pitfalls]]) | | 0.5 on the slider sounds almost silent | Linear value passed as dB | Convert with `20 * log10(linear)` | | Black screen after choosing a resolution | Unsupported mode in exclusive full screen | Build the list from `Screen.resolutions`; keep the 15 s auto-revert | | Refresh rate choice ignored | The docs: refresh-rate changes only work in **exclusive** full screen | Show the rate only as information in other modes | | Frame cap does nothing | `targetFrameRate` is ignored while VSync is on | Disable the cap control when VSync is on | | Quality reverts VSync | Each quality level stores its own VSync Count | Set VSync **after** `SetQualityLevel` (as `SettingsApplier` does) | | Wrong quality after an update | Saved index points at a reordered list | Keep quality levels in a fixed order, or store the name and look it up | | Resolution change "does nothing" in the Editor | In the Editor, `SetResolution` only affects the Game view | Test display settings in a build | | Settings differ between Editor and build | Editor PlayerPrefs use a different registry key | Expected; clear both when testing first-run | | Settings lost after renaming a field | No migration | Bump `SettingsData.CurrentVersion` and add a `Migrate` case | | Statics keep last session's values in Play Mode | Enter Play Mode Options with domain reload off | `RuntimeInitializeOnLoadMethod(SubsystemRegistration)` resets in every static class | | Gamepad cannot reach the buttons | No focus, or UI input not routed | `MenuRouter.Show` focuses the first button; check [[4. UI Input and XR Input]] | | Focused button invisible | Default theme focus style too subtle | Thick `:focus` border in USS (Level 8 clarity) | | Pause menu flickers HUD underneath | HUD panel still drawing | Disable the HUD `PanelRenderer` while paused (Clean Screen) | | Menu animations freeze while paused | Scaled time | `unscaledDeltaTime`, Animator *Unscaled Time*, particles *Use Unscaled Time* | | Menu sounds silent while paused | `AudioListener.pause` | `ignoreListenerPause = true` on menu `AudioSource`s | | Two `SettingsApplier`s after returning to Boot | `DontDestroyOnLoad` object re-created | Only load Boot once, or destroy duplicates in `Awake` | | Player saves progress in PlayerPrefs | Convenience | PlayerPrefs is unencrypted and per machine; use file saves ([[High Scores, Saves and Player Stats]]) | | Web build loses big settings | Web PlayerPrefs are limited (the 6000.5 page says up to 1 MB in IndexedDB) | Keep settings small; never store binding JSON for dozens of maps | ## Design pitfalls (Level Up!) - **Too many screens.** If any screen needs four presses, merge it into a tab ([[1. Menu Flow Design and the Level Up! Screen Map]]). - **Settings as a dumping ground.** Cheats and debug toggles go in the developer overlay ([[In-Game Debug Console and Cheat Tools]]), not in the player's menu. - **Unclear defaults.** "Defaults" must be the settings a new player would want, not the developer's machine. - **No way back.** Every screen has Back; every risky change has Revert. That is Level 13's "Love Thy Player" applied to UI. ## Sources - `AudioMixer.SetFloat` (6000.5): https://docs.unity3d.com/6000.5/Documentation/ScriptReference/Audio.AudioMixer.SetFloat.html - `Screen.SetResolution` (6000.5): https://docs.unity3d.com/6000.5/Documentation/ScriptReference/Screen.SetResolution.html - `Application.targetFrameRate` (6000.5): https://docs.unity3d.com/6000.5/Documentation/ScriptReference/Application-targetFrameRate.html - `PlayerPrefs` (6000.5): https://docs.unity3d.com/6000.5/Documentation/ScriptReference/PlayerPrefs.html