Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

PC Build - Custom Resolution NOT working ?

Discussion in 'Editor & General Support' started by Trickzbunny, Nov 3, 2016.

  1. Trickzbunny

    Trickzbunny

    Joined:
    Jun 26, 2015
    Posts:
    64
    Hello there!

    So I am trying to make a PC Build, with a custom resolution of 640x1136 (iPhone 5).
    I changed the settings in the Player Settings under Build Settings but it doesnt work. I have made 5-6 builds removing and readding the supported aspect ratios, testing out rezisable window etc. but nothing has worked.

    I cant get my 640x1136 to show up anywhere.

    Any help is highly appreciated! Thanks :)


    CustomResolutionNotWorking.PNG
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Non-standard resolutions won't work like that since the resolution dialog requires that all selectable resolutions must be able to work in windowed and full-screen mode, and Unity can't use a screen resolution that doesn't exist on your computer. The only way to do a non-standard windowed resolution is to disable the resolution dialog.

    --Eric
     
  3. riverdore

    riverdore

    Joined:
    Jul 21, 2012
    Posts:
    25
    Hi Eric, the issue seems to persist on my end despite disabling res dialogue.

    Any idea what the issue may be?
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    No, sorry, it works fine here.

    --Eric
     
  5. greg-harding

    greg-harding

    Joined:
    Apr 11, 2013
    Posts:
    519
    Try deleting your app's preferences file and then run it again.

    https://docs.unity3d.com/ScriptReference/PlayerPrefs.html

    After that it should use the default resolution settings you've entered. If you use the resolution dialog or change resolution those settings get saved and then reused when the app opens again and your defaults are ignored. You'll probably want to do a manual call to set things up at boot time.

    https://docs.unity3d.com/ScriptReference/Screen.SetResolution.html
    Code (CSharp):
    1. Screen.SetResolution(640, 1136, false); // iPhone 5 landscape, windowed
     
    Harinezumi likes this.
  6. AzkabanProfessor

    AzkabanProfessor

    Joined:
    Mar 9, 2017
    Posts:
    7
    I have a question, after “Screen.SetResolution”,then restart exe ,the default resolution will be the resolution of previous " Screen.SetResolution".How Can I start with default resolution rather than previous " Screen.SetResolution"?
     
  7. greg-harding

    greg-harding

    Joined:
    Apr 11, 2013
    Posts:
    519
    Just call Screen.SetResolution() with the values you want to use as the defaults.