Why does Editor play scale default to 2x

Every time I update Unity, start a new instance of the Editor, and sometimes even hit the play button, the scale of the game window goes to 2x. This is obnoxious. I do not want to zoom in, but Unity feels the need to show me a magnified part of my game.

Is there a way to prevent this or set some sort of hard-coded default?

The 1x setting obviously isn’t being stored and defaulting to 2x seems pointless.

I had this happen for a long time. I wanted it in 0.6x, but it would jump to 1.0x every time I played it. I found that by setting it to the desired size, in my case 0.6x, and then closing Unity and reopening it, fixed the problem.

I experienced this bug and resolved it by pressing pause first, and then pressing the play button to run the game already paused. The first time you do that, the screen no long resizes automatically and will stick to what you’ve entered. After doing that once it no longer resets to the 2x default, even without pausing.

Just close the Game window tab and reopen/redock it. Works for me in 2019.1 with 1080x1920 viewport.

A fix to previous solution. In my case if I edit the scripts, unity 2019.1.5 changes the scale of game window. So …
Just add this to your project.

using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
using Object = UnityEngine.Object;

[InitializeOnLoad]
[ExecuteInEditMode]
public class FixGameWindowScaleBug
{
    private static bool mUpdate = false;
    
    static FixGameWindowScaleBug()
    {
        EditorApplication.update += update;
        EditorApplication.delayCall += delayCall;
        SetGameViewScale();
    }
    
    private static void delayCall()
    {
        mUpdate = true;
    }
    
    private static void update()
    {
        if (mUpdate)
        {
            SetGameViewScale();
            mUpdate = false;
        }
    }

    private static void SetGameViewScale()
    {
        Type gameViewType = GetGameViewType();
        EditorWindow gameViewWindow = GetGameViewWindow(gameViewType);

        if (gameViewWindow == null)
        {
            Debug.LogError("GameView is null!");
            return;
        }

        var defScaleField = gameViewType.GetField("m_defaultScale", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);

        //whatever scale you want when you click on play
        float defaultScale = 0.1f;

        var areaField = gameViewType.GetField("m_ZoomArea", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
        var areaObj = areaField.GetValue(gameViewWindow);

        var scaleField = areaObj.GetType().GetField("m_Scale", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
        scaleField.SetValue(areaObj, new Vector2(defaultScale, defaultScale));
    }

    private static Type GetGameViewType()
    {
        Assembly unityEditorAssembly = typeof(EditorWindow).Assembly;
        Type gameViewType = unityEditorAssembly.GetType("UnityEditor.GameView");
        return gameViewType;
    }

    private static EditorWindow GetGameViewWindow(Type gameViewType)
    {
        Object[] obj = Resources.FindObjectsOfTypeAll(gameViewType);
        if (obj.Length > 0)
        {
            return obj[0] as EditorWindow;
        }
        return null;
    }
}

I filed this bug long time ago but there was no will to investigate it. Happens to me pretty often.

https://fogbugz.unity3d.com/default.asp?905861_3oejdu3vvh5ig422

A few things have made the 2x go away for me:

1. Restart Unity

2. Change Build Settings - (I went from Android to the default PC, Mac, & Linux Standalone. At least do the development while in that build setting and then when finally exporting the .apk, change it to Android.)

None of the other solutions worked for me.

Just use this code snippet

#if UNITY_EDITOR
void Awake()
{
    SetGameViewScale();
}

void SetGameViewScale()
{
    System.Reflection.Assembly assembly = typeof(UnityEditor.EditorWindow).Assembly;
    System.Type type = assembly.GetType("UnityEditor.GameView");
    UnityEditor.EditorWindow v = UnityEditor.EditorWindow.GetWindow(type);

    var defScaleField = type.GetField("m_defaultScale", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);

    //whatever scale you want when you click on play
    float defaultScale = 0.1f;

    var areaField = type.GetField("m_ZoomArea", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
    var areaObj = areaField.GetValue(v);

    var scaleField = areaObj.GetType().GetField("m_Scale", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
    scaleField.SetValue(areaObj, new Vector2(defaultScale, defaultScale));
}
#endif

What fixed this for me was choosing “Free aspect” resolution and ticking “Low Resolution Aspect Ratios”.

Edit: Actually this still uses 2x scale, but I guess the resolution is just half. The game graphics look jagged but at least not zoomed in all the time.

Could also try changing player from iOS to Android.

Had a similar issue in unity 2018.2 and the comments on this thread helped me fix it. While It wasn’t suffering from the wrong scaling, every time I clicked on the game view the UI element’s positions would change and take on some weird offset. I realised from this thread that it started after I switched platforms from PC to Android. How I fixed it:

  1. Removed all game view tabs from the editor.
  2. Hit play, then stopped it after it started running.
  3. Add a game view tab back to the editor.
  4. Hit play. Changed the aspect ratio to the one I was working with (android portrait)

Works fine now.

Without MonoBehaviour it can make:

`
using UnityEditor;
using UnityEngine;

[InitializeOnLoad]
public static class FixResolutionScale
{
static FixResolutionScale()
{
EditorApplication.playModeStateChanged += OnPlayStateChanged;
}

private static void OnPlayStateChanged(PlayModeStateChange playModeStateChange)
{
	SetGameViewScale();
}

private static void SetGameViewScale()
{
	System.Reflection.Assembly assembly = typeof(UnityEditor.EditorWindow).Assembly;
	System.Type type = assembly.GetType("UnityEditor.GameView");
	UnityEditor.EditorWindow v = UnityEditor.EditorWindow.GetWindow(type);

	var defScaleField = type.GetField("m_defaultScale", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);

	//whatever scale you want when you click on play
	float defaultScale = 0.1f;

	var areaField = type.GetField("m_ZoomArea", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
	var areaObj = areaField.GetValue(v);

	var scaleField = areaObj.GetType().GetField("m_Scale", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
	scaleField.SetValue(areaObj, new Vector2(defaultScale, defaultScale));
}

}
`

Solved the issue y setting aspect ration to 16:9 in game view.

Late answer but useful hope for someone.
Delete the “ClusterInputManager.asset” file in YourProjectFolder/Project Setting folder.
However, please backup it

Suffered from same problem.

But I find that it depends on two things:

  1. I have an extra screen with higher resolution, once I put the Game window to the extra screen, then it will set to 1x scale. However, once I put the Game view window to the 13’ mac screen, it will set to 2x scale.

  2. Also, if I change the build settings from IOS to MacOS or Windows, the default scale changed from 1x to 2x.

It is weird, although I know a little rule like this, still cannot solve this problem.

I have been facing a similar issue with my mobiles projects. After a lot of tests, the problem in my case seems to be related to how the Editor handle the Game tab scaling. To put thing in simple terms, whenever the content of the Game tab is smaller than half of the tab itself, it will scale it up to 2x automatically. It’s kinda like how the scale will be lower than 1x if the content is larger than the tab.


For example, on my 1920x1080 resolution screen, starting the Play with a custom resolution of 480x320 (smallest resolution to be supported for my mobile game project), as the height is 320 and fits at least twice in the 1080 height of the screen (which has at least 900 pixel of height if you don’t count the thing above and below the Game tab in the Editor), the game always plays at 2x scale automatically. Setting the game’s resolution to a fixed 2960 x 1440 (which is the largest resolution on the largest tablet on the public market at the moment I started the project) automatically drop the scale to 0.397… That makes the content in the Game Tab fit in said tab.


From this, the simplest fix to allow me to have the lowest resolution (480x320) to display at 1x is to set the Game Tab to a height lower than 2x your target resolution’s height. For me with 320 being the target height, making the Game Tab height lower than 640 pixels fixes the problem (in both orientation in this case too). To know how much the height of the tab should be, just press Play and as the screen is at 2x scale, drag the edge of the window below or above (in my case, the Console + Audio Mixer + Animator + Animation tabs are in a window below) until it’s just reaches the play screen edge at 2x. This will automatically forces the screen to drop to 1x instantly. Keep the windows/tabs at their size right there and it will never raise to 2x when pressing play.


Now, this is NOT a perfect solution, but it does fixes the scale defaulting to 2x needlessly when the Game tab’s content is small.

If you go onto the Game window, there should be a slider near the top. Make sure that is all the way to the left. Another problem could be in the camera itself. Go onto the main camera that you use and set the FOV (field of view) to 60, which is the default view. Adjust that further if needed.