My game launches on second monitor by default

When the game is played with multiple monitors, it doesn’t seem to ever open on the primary monitor, rather the second one, I was wondering if there was a way to set it to always open on primary monitor

I’ve tried using command line arguments, I read about “-adapter N” which says to force the game to a certain display adapter, which doesn’t work, read about it only working on d3d9, so I used “-force-d3d9” with it, then read in a forum that for d3d11 it’s “-gpu” but it doesn’t seem to work either, is there a way to achieve this?

Thanks in advance

My project was doing the same thing. I found that if I delete all the playerprefs made by unity ScreenManager and start the game fresh, it fixed the issue. I’m not using the Unity display dialog.

I believe if you are using the default Unity “Display Resolution Dialog” (Set to “Enabled”), found in the Standalone Player Settings, it will run on whichever monitor you open the application from.

If you are not using the Resolution Dialog (have it set to “Disabled”), your game will open on the “Target Display” setting of your Cameras and Canvases.

I haven’t found a way to open on the primary monitor by default yet, but I’m using a solution to switch monitors based on the player’s selection in my game’s setting menu at runtime. A comment in the answer of this post really helped me with switching monitors at runtime.

My Settings Menu:

My Code to switch monitors at runtime (C#):

IEnumerator TargetDisplaySwap(int targetDisplay, bool isFullScreen)
{
    // Store the current screen resolution
    int screenWidth = Screen.width;
    int screenHeight = Screen.height;

    // Setting this PlayerPrefs is what actually changes the monitor to display on
    PlayerPrefs.SetInt("UnitySelectMonitor", targetDisplay);

    // Set the resolution low for a frame
    Screen.SetResolution(800, 600, isFullScreen);    

    yield return null;     // Wait a frame

    // Set the previous resolution
    Screen.SetResolution(screenWidth, screenHeight, isFullScreen);      
}

Yeah, I was looking for the same thing, for it to be by default, thanks a lot for the help though, it’s really appreciated, it will be useful as a workaround for now