- Home /
Can I disable screen selection etc dialog at startup?
Hi, i'm fairly new to unity. i was wondering if it is possible to remove the graphics setup at the beginning of a unity game. after you build the game when you run it the is a grphics setup/input index. i wanted to know if it was possible to remove that.
@mirw9 Not a good title of your question. People with the same problem will not easily find this answer and will ask the same question again.
Agreed. It's an awful title. See: http://answers.unity3d.com/questions/133869/how-to-ask-a-good-question.html
sorry, i wasn't sure what to put, as it was my first question, thank you for fixing it.
Answer by aldonaletto · Jun 24, 2011 at 03:06 PM
You can bypass the startup resolution dialog: Build Settings -> Player Settings -> Resolution and Presentation -> Display resolution dialog: enable/disable.
At runtime, the resolution can be set by Screen.SetResolution - read about in:
http://unity3d.com/support/documentation/ScriptReference/Screen.SetResolution.html
I've never used this, and I read recently about a Screen.resolutions[] issue:
http://answers.unity3d.com/questions/132067/screenresolutions-problem.html
Answer by pgilmorepf · Jun 24, 2016 at 05:01 AM
I need to do the same thing, with a caveat: I'm doing this from an automated build system in 4 versions of unity: 4.7, 5.1, 5.2, and 5.3 I can't pre-set and save settings files that work in all 4 versions (I tried, it failed)
I need to set the player settings in script, before building the windows exe, or force it from the command line.
It sounds like command line isn't an option, so how do I set the Player Settings from c#, before making the call to make the build?
I eventually answered my own question:
PlayerSettings.SetPropertyInt("ScriptingBackend", (int)ScriptingImplementation.$$anonymous$$ono2x, BuildTargetGroup.Standalone); // Ideal setting for Windows
PlayerSettings.defaultIsFullScreen = false;
PlayerSettings.defaultScreenHeight = 768;
PlayerSettings.defaultScreenWidth = 1024;
PlayerSettings.runInBackground = true;
PlayerSettings.displayResolutionDialog = ResolutionDialogSetting.Disabled;
PlayerSettings.resizableWindow = true;
Hope this helps somebody!
Your answer
![](https://koobas.hobune.stream/wayback/20220612120514im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Why is the game scene empty when I press "play"? 1 Answer
Mesh's texture seems to be off by a small amount 1 Answer
'Forward-scroller' game? 0 Answers
Mobile Graphics Settings in Menu 1 Answer