• 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 /
avatar image
1
Question by LukaKotar · Apr 15, 2013 at 10:45 PM · issuefullscreen

Launching game in windowed mode by default (problem)

Hi.

I wanted to make a launcher screen, so I disabled the Display Resolution Dialog, and un-ticked the Default Is Full Screen option inside the Player Settings. I went ahead and built the game, launched it, and I noticed that the game was launched in full screen. I reenabled the resolution dialog, and I've seen the Windowed option was not selected. I also tried building to a different file name, as well as building an empty scene with no scripts attached - no luck.

Any tips are welcome.

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

6 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by LukaKotar · Aug 11, 2014 at 02:54 PM

OK, so I've figured it out, but I forgot to post the answer to this question. So here goes:

By looking through the PlayerPrefs keys (and a bit of messing around with them), I've found that Unity uses the following keys to determine what resolution the game will launch in:

  • "Screen Manager Resolution Width" - resolution X (int)

  • "Screen Manager Resolution Height" - resolution Y (int)

  • "Screenmanager Is Fullscreen mode" - 0 = windowed, 1 = fullscreen (int)

To work around the problem described in the question, set the keys to the desired value when the game quits. I recommend using OnApplicationQuit for the job, as it runs regardless of how the game quits (anything other than a crash).

 void OnApplicationQuit () {
     PlayerPrefs.SetInt("Screenmanager Resolution Width", 800);
     PlayerPrefs.SetInt("Screenmanager Resolution Height", 600);
     PlayerPrefs.SetInt("Screenmanager Is Fullscreen mode", 0);
 }

Note that you will have to create a new PlayerPrefs key or two to keep track of the users previous resolution. (You don't want your players to have to select the desired resolution every time they open the game.)

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 VMM1 · Jan 28, 2017 at 04:02 AM

Windows records a full screen setting on a program-by-program basis in the system registry, which Unity alters for some reason, but which can be easily changed back. It's only scary the first time. Run command "regedit", to bring up the Registry Editor. Under HKEY_CURRENT_USER > Software, you'll find an option for whatever you put as "Company Name" in player settings, with any associated games underneath. Choose the game in question, and look for item "Screenmanager Is Fullscreen mode.xyzxyz" Double-click, and if Value data: field has 0, change it to a 1.

I forget what it looks like under Software, if you left Company Name field blank. Something generic shows up, just look around.

Comment
Add comment · Show 1 · 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 VMM1 · Jan 28, 2017 at 03:53 AM 0
Share

Now, having conquered that one a while ago, I'm now facing a offshoot problem. Specifically when a program is opened from the Startup folder when booting up, this registry setting is overridden. I'm sure there's another 0 to change to a 1 somewhere, but I have no idea where. If anybody does, please holler.

avatar image
8

Answer by Engelsted · Aug 11, 2014 at 10:16 AM

I had the same problem. I believe that Windows remembers the settings regardless of the dialog box is off if you have already run the application once with the dialog box on.

I fixed this by changing the Product Name in Playersettings and forcing Windows to treat the application as new.

Comment
Add comment · Show 4 · 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 Flurre · Mar 02, 2016 at 09:47 AM 1
Share

This was exactly what was happening here. Thanks!

avatar image filip-vondrasek · Dec 14, 2016 at 05:49 PM 0
Share

Had the same problem, that fixed it, thanks. Is there, however, any other solution? If I somehow accidentally bump into this problem again, there surely must be other solution than changing the product name.

avatar image Austin_Hey filip-vondrasek · Apr 25, 2019 at 10:06 AM 0
Share

I know it's an old post, but I encountered the same problem with unity 2019. You can also clear all player pref by going to Edit > Clear All PlayerPref

:)

avatar image Graithen · Jun 06, 2019 at 05:21 PM 0
Share

This will fix the issue. Good effort, been annoying me for a couple of days!

avatar image
0

Answer by DarkSlash · Sep 23, 2013 at 06:25 PM

Same problem. I removed all references to Screen, but the problem still there. So I put this line in the script of the first scene, and the problem's gone: Screen.fullScreen = false;

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
-1

Answer by raannnndommm · Jul 06, 2013 at 06:25 AM

I believe it is a unity problem. Try setting full screen default. P.S "Windowed" means its not full screen.

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
  • 1
  • 2
  • ›

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

20 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

Related Questions

Full Screen Get smaller when i actived it 1 Answer

Flying object x value for position keeps resetting itself 0 Answers

Problem with editor 1 Answer

Textures sizes Web/PC vs iOS. 1 Answer

Unity c# Raycast axis stuck on one axis 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