Search Unity

Game view scale always resets to 2x

Discussion in '2019.1 Beta' started by btristan, Mar 5, 2019.

  1. btristan

    btristan

    Joined:
    Oct 15, 2018
    Posts:
    37
    Every time I press the play button the scale slider in the Game tab jumps to 2x. This means I need to slide it down to 1x to see the entire game view. But after I exit play mode and press the play button again it jumps back up to 2x.

    I wanted to see if this was just me or if someone has a solution.
     
  2. btristan

    btristan

    Joined:
    Oct 15, 2018
    Posts:
    37
    Looks like this also happens whenever scripts finish compiling.
     
  3. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,592
    Can you reproduce this issue in a new project? Can you reproduce this issue in an older Unity version? Do you have more than one Unity editor open?

    If something resets when entering play mode, it's often related to Unity's assembly reload, where it re-initializes a lot of things. It often reads settings via EditorPrefs, to restore settings, which is shared among editor instances.

    You probably tried this already, but just to make sure.
    • Close all Unity editor instances
    • Open a single editor
    • Set slider to 1x
    • Close editor
    • Open your project and check if the issue persists
    This should make sure that Unity writes this setting to disk/registry. So if an assembly reload occurs, Unity should pick up the extising values stored on disk/registry.
     
  4. btristan

    btristan

    Joined:
    Oct 15, 2018
    Posts:
    37
    Ok, now this is very odd. I closed all editors then created a new project via the Hub.

    Now the slider's minimum value is 2x:
    Screen Shot 2019-03-05 at 13.44.18.png

    So I can't actually set it back to 1x. Very interesting. It this point I'll definitely make a bug report. :) But I don't know how to reproduce it.
     
  5. btristan

    btristan

    Joined:
    Oct 15, 2018
    Posts:
    37
    When I open up a 2018.3.0f2 editor (another new project) the minimum on the Scale slider is also 2x. So the minimum value of the slider is somewhere in config, not just the current value?
     
  6. btristan

    btristan

    Joined:
    Oct 15, 2018
    Posts:
    37
    Opening up older projects shows a minimum value of 1.x but it keeps jumping up to 2x.
     
  7. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    5,195
  8. btristan

    btristan

    Joined:
    Oct 15, 2018
    Posts:
    37
    Changing "Low Resolution Aspect Ratios" does let me go down to 1x. Thanks @mgear !

    However, it does not fix Unity jumping to 2x whenever I go into play mode or compile scripts. It does that regardless of the state of the checkbox.
     
    Last edited: Mar 5, 2019
  9. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    474
    That was bothering me for a long time too, so it's not exclusive to 2019.x. Today I've decided to find a solution, I've even put together a small editor script that fixes it by resetting it to "1" after a re-compile or on the play mode.

    Then I think I've found the actual issue/solution, give this a try:
    1. Switch to "PC, Mac & Linux Standalone" platform.
    2. Click on Resolution and un-tick "Lo -Resolution Aspect Ratios" there.
    3. Switch back to iOS/Android and try again...

    That fixed the 2x issue for me. I think somehow a standalone target setting also affects other platforms, causing the issue.
     
    exafred, CodeerThijmen and 5argon like this.
  10. btristan

    btristan

    Joined:
    Oct 15, 2018
    Posts:
    37
    This worked! Thanks so much @PixelEnvision .

    Still a Unity bug, I only started getting this odd behaviour in b5.
     
    Last edited: Mar 6, 2019
  11. antoine-unity

    antoine-unity

    Unity Technologies

    Joined:
    Sep 10, 2015
    Posts:
    58
    Hello,

    We haven't seen this issue so far, it would be very useful you could submit an issue with Unity's Bug Reporter (Help > Report a bug)

    Thanks!
     
  12. btristan

    btristan

    Joined:
    Oct 15, 2018
    Posts:
    37
    Already uploading! :) I'll post the number when I get it.
     
  13. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    474
    @antoine-unity FYI, I think that's only true for converted/upgraded projects, doesn't seem to be happening with a new project.

    Also, I think I've found a better fix. Above is working for 2x issue but if you have a larger than game view resolution and working with something like 0.8 scaling factor, it was still resetting it back to 1x on play mode.

    Try quitting Unity and deleting ProjectSettings/EditorSettings.asset file. The file will be recreated with default settings on restart so you might want to take a note of your current settings before doing that.

    That seems to be working on most (but not permanent on few) of my projects...
     
  14. btristan

    btristan

    Joined:
    Oct 15, 2018
    Posts:
    37
    Bug number: 1134391
     
  15. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    1,410
  16. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    767
    Yes, please address this issue! It's beyond annoying having to adjust that slider on every play.
     
  17. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    87
    On a related note, we're also working at re-designing this feature, which is causing a lot of confusing, even amongst ourselves.

    The Low Resolution Aspect Ratios checkbox will be replaced with a pixel size selector. The Game view zoom slider won't be affected by that value, and will snap to integer values. The computed scale factor of the Game view will be zoom value times the pixel size value.

    We're hoping this will be more intuitive. What do you think?
     
  18. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    87
    Not professionally. Do you have examples of what it's doing right in that regard?
     
  19. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    87
    Great, I'll check it out. Thanks!
     
  20. JustAnotherDude

    JustAnotherDude

    Joined:
    Oct 28, 2013
    Posts:
    128
    Any chances of this fix entering 2019.1.6? It's so incredibly annoying, mine always resets to 1x...

    Using 2019.1.5 right now, and this only happens on one of my projects...

    (And it doesn't have any code that messes with resolution or scale or the editor at all)
     
  21. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    87
    The backport to 2019.1 is currently being worked on, I have no ETA to give though.
     
    Last edited: Jun 11, 2019
    JustAnotherDude likes this.