Reputation:
Hi guys my resolution upon running my newly build app is always 1920 x 1080 now I want to set it to 1280 x 720 fullscreen resolution . So what I did are this
PlayerSettings.defaultScreenWidth = 1280;
PlayerSettings.defaultScreenHeight= 720;
and also I set it on my Player Setting just to be sure
So here's how I find out that my resolution is not resetting
resolution.text = Screen.currentResolution.ToString();
Here's the solution I tried so far
On this forum
Unity Forum. Where in tried also deleting the registry key in windows but that didn't work . I even tried also deleting the playerprefs but unfortunately that doesn't work also.
Could someone please help me with a remedy to this problem.
Upvotes: 0
Views: 2562
Reputation: 122
If it's running windowed, according to Unity, Screen.currentResolution will return the current resolution of the desktop. So it'll show in your UI text 1920 x 1080 because of your desktop resolution. I just tried this and it worked fine:
void Awake()
{
Screen.SetResolution(1024, 768, true); // true for setting fullscreen as you wanted
}
Also according to Screen.SetResolution, "a resolution switch does not happen immediately; it will actually happen when the current frame is finished".
Upvotes: 0
Reputation: 103
Try to change it from your Canvas
For fullscreen settings ,try to follow this guide: https://answers.unity.com/questions/48778/full-screen-mode.html
Upvotes: 1