Screen.currentResolution with Unity 5.2.1

We are using unity to develop a desktop application, and we were using Unity 4 previously. Now we have upgraded our project to Unity 5 (5.2.1). We have an issue with setting the screen resolution. We used Screen.SetResolution (Screen.currentResolution.width, Screen.currentResolution.height, true); in Unity 4 to set the resolution and it works fine. But in unity5 Screen.currentResolution.width doesn’t gives the correct value. Is there anything new with Unity 5.2.1 ?

Same thing happened to me, I just used Screen.width and Screen.height to get the current resolutions, and Screen.resolutions for a list of supported full screen resolutions (last element in the array being the largest).

This should work for you, you can even cycle though this array in your options menu so the player can adjust resolution.

Resolution[] allRes = Screen.resolutions;
Screen.SetResolution(allRes[allRes.Length-1].width, allRes[allRes.Length - 1].height, true);