Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Blue flickering on Screen.FullScreenMode runtime change.

Discussion in 'General Graphics' started by Asaioki, Jun 22, 2020.

  1. Asaioki

    Asaioki

    Joined:
    Aug 1, 2016
    Posts:
    43
    Hey there,

    I'm currently working on a settings menu and I am running into an issue on my newest build.

    Whenever i change the Screen.FullScreenMode to FullScreenMode.ExclusiveFullScreen or FullScreenMode.FullScreenWindow the game begins to produce a blue flickering. I should probably note that I am using HDRP.

    Here is the code where I am changing the FullScreenMode:
    Code (CSharp):
    1. switch (screenMode)
    2.         {
    3.             case ScreenMode.Fullscreen:
    4.                 if (Screen.fullScreenMode != FullScreenMode.ExclusiveFullScreen)
    5.                 {
    6.                     //Produces blue flickering.
    7.                     Screen.SetResolution(resolution.width, resolution.height, FullScreenMode.ExclusiveFullScreen, resolution.refreshRate);
    8.                 }
    9.                 break;
    10.             case ScreenMode.Borderless:
    11.                 if (Screen.fullScreenMode != FullScreenMode.FullScreenWindow)
    12.                 {
    13.                     //Produces blue flickering.
    14.                     Screen.SetResolution(resolution.width, resolution.height, FullScreenMode.FullScreenWindow, resolution.refreshRate);
    15.                 }
    16.                 break;
    17.             case ScreenMode.Windowed:
    18.                 if (Screen.fullScreenMode != FullScreenMode.Windowed)
    19.                 {
    20.                     //No flickering.
    21.                     Screen.SetResolution(resolution.width, resolution.height, FullScreenMode.Windowed, resolution.refreshRate);
    22.                 }
    23.                 break;
    24.         }