Search Unity

Player Preferences Resolution Question

Discussion in 'Editor & General Support' started by Burglebutt, Oct 20, 2018.

  1. Burglebutt

    Burglebutt

    Joined:
    Jul 24, 2014
    Posts:
    51
    Hi there!

    I use this code to set the resolution I need.

    PlayerPrefs.SetInt(RESOLUTION_PREF_KEY, currentResolutionIndex);

    I use this code to find out what the previous resolution was for next time I load the build.

    currentResolutionIndex = PlayerPrefs.GetInt(RESOLUTION_PREF_KEY, 0);

    The issue I have is that when you load the build and change the resolution it still thinks it's the resolution that was set in the code. So if I left it at 800x600 when I last played, but this time I want to load it at 1900x1600 it still thinks its 800x600. Is it possible to find out the resolution chosen when you start the build? Thanks!