Video Settings displaying wrong information

Hello, im having a problem with the settings.
I followed this tutorial.

however,every time i open the game the Video options show -Very low- and a 320 x 240 resolution, however, the real resolution is the one i picked before and the settings are at high, but the graphic display is showing the wrong information, how can i fix this?.

{
    public AudioMixer AudioMixer;
    public Dropdown dropdown;
    public Dropdown dropdownresolution;
    public bool FullScreen;
    Resolution[] resolutions;


    private void Start()
    {
       resolutions =  Screen.resolutions;
        dropdownresolution.ClearOptions();
        List<string> options = new List<string>();
        int currentResolutionIndex = 0;
        for (int i = 0; i < resolutions.Length; i++){
            string option = resolutions[i].width + "x" + resolutions[i].height;
            options.Add(option);

            if( resolutions[i].width == Screen.width && resolutions[i].height == Screen.height )
            {
                currentResolutionIndex = i;
            }
        }
        dropdownresolution.AddOptions(options);

    }

    public void setResolution (int resolutionIndex)
    {
        Resolution resolution = resolutions[resolutionIndex];
        Screen.SetResolution(resolution.width, resolution.height, Screen.fullScreen);
    }
    public void SetQuality(int qualityIndex)
    {
       QualitySettings.SetQualityLevel(qualityIndex);
    }

public void SetFullScreen ()
    {
        if (dropdown.value == 1)
        {
          FullScreen = false;
        } else { FullScreen = true; }
        Screen.fullScreen = FullScreen;
    }

Well, the code you showed here doesn’t appear to show you populating the dropdown for Quality, so I don’t know what that’s about. But, if you’re running this in the editor, I don’t believe that screen resolution changes are actually honored in the editor. Instead, the resolution is based on what the Game screen has been set to. For example:

4491859--413962--upload_2019-5-1_22-24-16.png

I have a similar Options dialog in my game, and the resolution doesn’t change in the Editor, only in a full build of the game. What resolution do you have chosen in the Game view? I’d guess you have one chosen that doesn’t exactly match any of the resolutions you’re adding to your list, so the first one is getting selected by default in the options dialog.

1 Like

you need to select your resolution’s option in start if you don’t dropdown select first option as always

thats in the build the bug, not in the editor, in the editor it seems to work fine. but when i build it i have that issue.

Bud are you listening? In your code you’re not setting dropdown index to your resolution index so of course you can’t see current resolution in dropdown

1 Like

OHHHHH i didnt realized. sorry, i read but i didnt understand.

im my editor im using the Free aspect.

 dropdownresolution.AddOptions(options);

So, since this option clears all the previous options and add new ones, i should make a variable to store the value? or maybe use a INT along with playersprefs and make it save when i leave the options tab?
What would be the best way to do it?

write this to end of Start void

dropdownresolution.value = currentResolutionIndex;
dropdownresolution.RefreshShownValue();
1 Like

Dude you are awesome! thanks for helping me there!