Skip to content

[BUG] Audio levels aren't persisting #473

@ViMaSter

Description

@ViMaSter

Describe the bug

Audio settings sometimes reset to the default, rather than the player preferences. After this occurred once, the default levels continue to be used and the player's changes are discarded with no way to restore them.

Steps To Reproduce

No 100% reliable repro on this, unfortunately. What I was doing when it happenec:

  1. Start the main menu in the editor
  2. Change the Master audio levels to almost 0%
  3. Start the game
  4. Load the dev kit
  5. Use Ctrl+R multiple times and reload the script
  6. Press the Unity play button to stop the scene
  7. Open the Game and MainMenu scenes a bunch of times and press the Unity play button

After doing this a few times, SFX and Music randomly were playing way louder and the settings menu values were reset to as if the user hadn't changed the levels at all.

It's unclear why this happens in the first place and I've yet to check if the game persists the default levels as the user's preference after or reliably fails to load them after this occurred once. (Since the wrong levels persist even across Unity play button presses, I assume the wrong settings are written to the PlayerPrefs.)

Expected behavior

The user's set audio levels persist across Ctrl+R reloads, Unity play button presses and editor restarts.

Additional context

Reproducible in 4e52fd1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    audioImplementing audio assets into the gamebugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions