- Home /
Question by
michwisz · May 21, 2018 at 02:48 PM ·
resolutionmultipledisplays
MultiDisplay - main display resolution changes itself to native
Hi everyone,
I've faced a weird issue - I'm working on a project which requires using more than two displays. The problem is, that no matter what resolution I've set in project build properties, after launch project is changing main screen resolution to native. I've tried to use Screen.ScreenResolution
, but it makes other displays uninteractable (e.g. buttons doesn't react on clicking them). Moreover, with using display dialog, chosen settings are being ignored on game launch. Is this a bug, or am I doing something wrong?
This is the code i use:
public int number;
void Start () {
Screen.fullScreen = true;
QualitySettings.SetQualityLevel (5, true);
QualitySettings.antiAliasing = 1;
number = Display.displays.Length;
Display.displays [0].SetParams (1920, 1080,60 ,0);
//hardcoded 6 displays for unity editor
#if UNITY_EDITOR
number = 6;
#endif
if (number > 1){
for(int i = 1; i < number; i++)
Display.displays [i].Activate (1920, 1080, 60);
}
}
Thanks in advance for any suggestions!
Comment