Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Screen resolution from Play mode in Editor vastly differs from the Build

Discussion in 'Editor & General Support' started by mrdaljama, Jul 31, 2023.

  1. mrdaljama

    mrdaljama

    Joined:
    Sep 27, 2019
    Posts:
    5
    I am currently facing a problem that I cannot search the exact answer in google nor chatGPT. I hope someone here has the answer. So, my problem is why do my editor>play mode resolution display vastly differs from my actual game build?

    Video clip of the whole process: Link
     
  2. mrdaljama

    mrdaljama

    Joined:
    Sep 27, 2019
    Posts:
    5
    Okay, I manage to fix it, but the problem now is when I finally set the width and height in the player settings to a much lower value, when I build it and played the build, the resolution stays the same as to when it was previously and I had to force a resolution change via script using
    Code (CSharp):
    1. Screen.SetResolution(576, 1024, false)
    why is that?
     
  3. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
    You try to use the 1080x1920 resolution. This likely exceeds the vertical resolution of your (and: most other people's) monitor: it doesn't have 1920 rows. Therefore Windows does the reasonable thing and scales down the window.

    It *may* work if you force the app to run in exclusive fullscreen mode. But probably not because 1080x1920 is not a standard resolution or aspect ration on desktop computers.
     
  4. mrdaljama

    mrdaljama

    Joined:
    Sep 27, 2019
    Posts:
    5
    Hello, yes, I set the resolution to a much smaller value now. 360x640 (9:16) in the player settings but when I build the game, it is still the same size of my previous build. Unless I force it via script.