Search Unity

can't change resolution for standalone build

Discussion in 'Editor & General Support' started by ullman, May 6, 2015.

  1. ullman

    ullman

    Joined:
    Dec 29, 2014
    Posts:
    7
    I posted this on Unity answers and didn't get any answer, so I'm posting it here.

    Ok, I just updated to Unity 5, and I've been trying to figure this out for long while now. No matter what resolution I set for windows standalone player settings, I get the same 720:480 resolution. I've turned off/on the display resolution dialog. looked around in the settings. Nothing. All I get is the default 730:480... I tried to do it through code just to see what happens and it's completely ignored. I even set full resolution to false and it went fullscreen. All the aspect ratio settings in the player settings are checked. The resolution looks fine in the game preview window, but does not translate into the final build.

    Anyone can tell me what I'm doing wrong here?
     
  2. jough

    jough

    Joined:
    Aug 18, 2013
    Posts:
    39
    Hey there ullman,
    I think I may have come across the answer for you a littler earlier after some searching. I really hope it's a bug and not a feature.

    Whenever you build a new game using Unity, it saves a registry key (in windows) or a preference file (On Mac) under the Company Name You selected for the player settings. By default, this is “DefaultCompany”.

    The registry key or preference file will still contain old display settings and other settings that are NOT over-written when you hit build, if you are building using the same Company Name. This will lead to Unity using the nearest resolution to what you have selected as a standard resolution supported by the video card.

    To fix this, locate the following registry key in windows - HKCU\Software\[company name]\[product name]and delete the entire key and rebuild, then run the game. You can access your registy by typing "regedit" (without the quotes) into your windows search, or if you are using Win8 you can hit the windows key and just type "regedit" (without the quotes) and windows will locate it for you.

    In Mac, delete the corresponding preferences file located in ~/Library/Preferences/unity


    Source: http://cinema-suite.com/unity-tip-running-a-custom-fullscreen-resolution/
     
  3. ullman

    ullman

    Joined:
    Dec 29, 2014
    Posts:
    7
    Wow, this actually worked. I was beginning to question my own sanity after the last couple of days. Phew. Thanks a lot for your help!
     
    rklausch likes this.
  4. michealcaj

    michealcaj

    Joined:
    Aug 18, 2017
    Posts:
    34
  5. nobelxer

    nobelxer

    Joined:
    Aug 24, 2016
    Posts:
    1
    worked like a charm!
     
  6. oultrox

    oultrox

    Joined:
    Oct 4, 2016
    Posts:
    3
    Thank you so much for this!
     
  7. Zante

    Zante

    Joined:
    Mar 29, 2008
    Posts:
    357
    Yes, thanks. I can't believe this hasn't been addressed in three years?

    I'm creating an app launcher in Unity 5.6 (as 2017 uses libcurl which stops files being accessed from my server).

    Deleting the registry key, as mentioned, works like a charm. This is not an intuitive solution and it still presents me with the problem of how to modify this on any clients/launchers I distribute.
     
    Last edited: May 21, 2018
  8. lightcollector

    lightcollector

    Joined:
    Aug 10, 2018
    Posts:
    1
    Oh great! I was beginning to getting mad at this problem. Worked perfectly.

    Just to point that HKCU refers to "hkey_current_user" for future windows noobs like me.

    Thanks so much!
     
  9. BrienKing

    BrienKing

    Joined:
    Oct 11, 2015
    Posts:
    32
    Thank you, I was pulling my hair out on this one too!
     
  10. Random_100

    Random_100

    Joined:
    Jan 28, 2019
    Posts:
    1
    I can't seem to get this to work.
     
  11. Slimboy1990

    Slimboy1990

    Joined:
    Jul 10, 2018
    Posts:
    2
    I honestly dont understand why this has not been fixed yet. I really start to doubt the capability of unity.

    Thank you a thousand times mate.
     
  12. CaseyHofland

    CaseyHofland

    Joined:
    Mar 18, 2016
    Posts:
    11
    This is working for the resolution, but I have a looot of trouble to change the fullscreen mode, honestly it seems to happen at random. I delete the regedit, restart Unity, nothing. Then, after doing this 2 more times for other reasons (fullscreen switch, single instance) it suddenly decides to finally save my changes!

    EDIT:
    So I found out that the "Fullscreen Mode" Setting is... different than I thought. I think a better name for it would be "Default Screen Mode". Apparently, the screen mode you select is what the game will open with the first time you play it, where as I though it meant what the executable understood under "fullscreen" (windowed, for example, being a maximized window). After a bit of studying up in the documentation things are starting to get more clear, but it's still annoying how much of a hassle this seemingly simple issue actually is.
     
    Last edited: Jun 3, 2019