Search Unity

Setting a QualitySettings value modifies the curent QualityLevel.

Discussion in 'Editor & General Support' started by DavidBVal, Sep 18, 2020.

  1. DavidBVal

    DavidBVal

    Joined:
    Mar 13, 2017
    Posts:
    206
    I have a quality level called "Ultra" with the shadowDistance set to 500. Then I allow the user to adjust a custom value for shadow distance, and he changes it to, let's say, 100. In my code I do QualitySettings.shadowDistance=100 and it works fine.

    However this seems to have the undesired effect of modifying the "Ultra" setting, reducing the shadowDistance to 100 for this setting. I've tested it, and it's what it does, at least while the game runs. If I later switch to "Ultra" from another level, it sets shadowDistance to 100, not to 500.

    So what am I supposed to do if I want the user to be able to start in one preset, then change one of the values? Right now the only way I see would be:

    1) create a new Preset called "custom" in the project
    2) when the user changes a setting, copy to "custom" manually every value from current quality setting, then...
    3) switch current Quality to "custom", then...
    4) apply the modified setting.

    Is there an easier way I am missing? Step 2 feels a bit weird.
     
    Last edited: Sep 18, 2020
  2. ThySpektre

    ThySpektre

    Joined:
    Mar 15, 2016
    Posts:
    362
    Just ran into the same thing today. It does seem strange.