Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by danielheadbang · Sep 29, 2016 at 12:40 PM · unity 5multiple-monitorsmonitor

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

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by MGSoft · Oct 27, 2016 at 06:01 PM

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: A screenshot of 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);      
 }



settingsmonitorselect.png (241.0 kB)
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by danielheadbang · Oct 27, 2016 at 06:06 PM

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

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by PiscesStudios · Jan 30 at 05:30 AM

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

115 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Display.displays.Length is count "2". But multi monitor doesn't work! :( 0 Answers

Unity Duel Monitor Help!? 1 Answer

How to display distance between Player and object in UI text? 0 Answers

How to differ loop animation for the instances of Game Object 0 Answers

How do I change the child inside a Photon Network instantiated gameobject so that the change is observed by all other users too? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges