Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Error “Couldn’t switch to requested monitor resolution

Discussion in '2021.1 Beta' started by Lex4art, Jan 14, 2021.

  1. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    Updated my project to recent 2021.b2 and got this when trying to run build:
    Unity 2021.1b2 resolution error on builded project start.png
    Is it just me or this is something major to be bugreported? 2021.b1 was fine there, no error.
     
  2. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    Found source of the problem - error caused by script that is trying to set display resolution:
    Code (CSharp):
    1. Screen.SetResolution(Display.main.systemWidth, Display.main.systemHeight, true);
    Happens only when DirectX12 is used in project settings (tested only on Unity 2021.b2 with native HDRP).
    Bugreported (Case 1306126).
     
    LeonhardP likes this.
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    Hey, thanks for the bug report. It seems that this bug only reproduces in non-development build. As a temporary workaround, build the development player. A fix is on the way!
     
    LeonhardP and Lex4art like this.
  4. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    445
    Hope so! With more testing I've noticed that this bug can rarely appear at random right after scene loaded/reloaded and crash Player, without my scripts involved it seems... Now switching back to Unity 2021.1b1 - hope that famous error "Month should be in [1-12] range" will not cause troubles in build XD.
     
    Last edited: Jan 27, 2021
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    The fix landed to 2021.1.0b6.
     
    LeonhardP and Lex4art like this.
  6. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,135