Quality settings reset after scene loads

Hello!
I have a settings menu with an option of changing graphics. When a player dies, the scene reloads. My problem is if the player switches graphics in the settings then dies, the graphics default to normal and not what the player wanted them to be at.
How would I fix this?
Thanks.

You could use PlayerPrefs to store the player’s preferences and access them every time the scene is loaded to apply the proper graphics. Bonus: It would also remember the preferences between game sessions (after exit/restart).

Here is how you set PlayerPrefs

PlayerPrefs.SetInt("GraphicQuality", 10);
PlayerPrefs.SetString("Resolution", "3840x2160");

And here is how you access them

int GraphicQuality = PlayerPrefs.GetInt("GraphicQuality");
string Resolution = PlayerPrefs.GetString("Resolution");

So, here is how you could do it:

  1. When loading the scene, a script
    should try to read the PlayerPrefs
    and apply the custom settings.
  2. If no PlayerPrefs for a specific
    graphic setting is defined, use the
    default.
  3. When the user edits a
    graphic setting, save the new value
    as a PlayerPref

Hope this helps.

I’m pretty new to player prefs, so how would I go about that?
Thanks.