- Home /
Launch Standalone Player from certain monitor
When running my Unity game's .exe, the game window opens as full screen on my monitor number 1. I'd like it to open full screen on monitor number 2.
Is there any code I can put in my game, any setting in the editor, or any command line argument, that will achieve this?
I've seen similar questions/answers on this forum, but none that quite answer this, as far as I can tell. For example, I do already have "Display Resolution Dialog" as "Disabled" right now. And I have tried -adapter 2
as a command-line arg.
I've even set my Camera objects' "Target Display" to "Display 2", but then when running the .exe from the Build, the window still opened on monitor number 1. Except now it was pitch black, just as it looked in the Unity editor's Game view when I have "Display 1" selected instead of "Display 2".
Talkin' Windows, btw.
EDIT:
Using this question, it kind of works. I used the solution mentioned in the comments, where it uses PlayerPrefs.SetInt("UnitySelectMonitor", MONITOR_NUM);
and Screen.SetResolution
. When running the game, the first time it opened still on monitor 1, which I did not want. But when running it again, it from then on opened on monitor 2, which is good. Still curious if possible to get it to run on monitor 2 on even the first try. Any thoughts?
Did you ever get any clarity on getting it to open up from $$anonymous$$onitor 2?