Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

Help Wanted One scene in build is forcing "use native resolution."

Discussion in 'Editor & General Support' started by gewl, Apr 5, 2021.

  1. gewl

    gewl

    Joined:
    May 19, 2016
    Posts:
    24
    I'm making a 3D game on Unity 2020.3 LTS and using URP. In player settings, I have 4:3 as the only supported aspect ratio and 1600x1200 for the default resolution.

    I clear my Registry before each boot. When I boot into my 'main menu' scene, the game's display is correctly in 4:3 with pillarboxing, and the playerprefs in my Windows Registry show 1600x1200 for all relevant resolution settings: Height, Height Default, Width, and Width Default. Use Native & Use Native Default are also set to 0.

    However, on loading my actual game scene, Use Native is set to 1, Width is set to 1920, and my game is rendering at 1920 x 1200 without pillarboxing. I've searched my entire codebase for PlayerPrefs.SetInt, Screen.SetResolution, and every other relevant method, but have not turned anything up that could be causing this.

    I get the same behavior when I build just my game scene out, without the main menu scene—the game starts at 1600x1200, then loads in at 1920x1200.

    Does anyone have any idea what could be causing this? Is there anything aside from a PlayerPrefs.SetInt call that could be overwriting my Use Native Resolution player setting?
     
  2. Pheck

    Pheck

    Joined:
    Jul 9, 2009
    Posts:
    199
    I have been seeing a similar issue in 2020.3. (havnt tried a newer build yet)
    When i make a new build, there is a very high chance the first time i play it will set it to native res (4k in my case). But no where in my game do any settings or code ever try to set or allow 4k in anyway. Often if I quit and play again, it will correctly play at 1080.... but if i make a new build, it happens again.
    If I go into my settings menu, I can set it to 1080 by hand, but even writting code to hand set it to 1080 on launch doesnt fix this odd issue.
     
unityunity