Sign in to follow this  
LiziPizi

Why game window automatically scale itself when I press play?

Recommended Posts

When I am in the Unity editor and I press play to test my game something weird happens,
the game window is like zooming in.. and I am not touching anything, the scale slider just goes from x0.41 to x1.
What may cause the problem? Bug in the editor?

Thank you in advance.

PS:
I noticed that the problem is only with my custom game windows, their initial scale is 0.41 and not 1, why is that?

Edited by Elgauly

Share this post


Link to post
Share on other sites

Reset your window layout and it will probably make it all go away.

I'm guessing you saved your layout with the wrong scale level, and it keeps getting restored to the wrong values.

 

The game view scale was needed to support high-dpi development on regular-dpi devices, or if you have a high pixel-density screen and want to preview small-pixel devices.  That way you could view what the game view is supposed to look like on displays that don't match your own.

Perhaps you are on a relatively small 1024x768 display, but your game window needs to preview the world as it looks on a 4K monitor with a 4096x2160 display. In that case you'll need to zoom the game window out to view it.  Or maybe you've got a nice 4K display yourself and are making games for a smart phone, you will want to zoom in so you're not looking at a tiny square.

Reset the scale level to 1 (unless you need a different value for those reasons) then stop touching it. Save your layouts with the 1.0 scale, and then pretend the slider doesn't exist.

Share this post


Link to post
Share on other sites

Reset your window layout and it will probably make it all go away.

I'm guessing you saved your layout with the wrong scale level, and it keeps getting restored to the wrong values.

 

The game view scale was needed to support high-dpi development on regular-dpi devices, or if you have a high pixel-density screen and want to preview small-pixel devices.  That way you could view what the game view is supposed to look like on displays that don't match your own.

Perhaps you are on a relatively small 1024x768 display, but your game window needs to preview the world as it looks on a 4K monitor with a 4096x2160 display. In that case you'll need to zoom the game window out to view it.  Or maybe you've got a nice 4K display yourself and are making games for a smart phone, you will want to zoom in so you're not looking at a tiny square.

Reset the scale level to 1 (unless you need a different value for those reasons) then stop touching it. Save your layouts with the 1.0 scale, and then pretend the slider doesn't exist.

 

Unfortunately resetting the layout didn't work. The game view scale level is related to the actual game view window size. When I make the game view window smaller then the scale level automatically changes. 

So now, with my current game view window size, my scale level is 0.28 and when I start the game it goes automatically to 1, then I need to go and change it back to 0.28 every single time after I press play.

I am almost certain that it's a bug. I use Unity for almost a year and stuff like this happen regularly, this is so frustrating.. 

Share this post


Link to post
Share on other sites

There was a similar bug, but found and fixed about a year ago so it should still be among the regression tests.  You can search the bug database to see if your specific variation exists.

I suspect yours is as designed since it switches when you start the player and reverts back once you stop the player.  You're generally not supposed to scale in the way you describe.

Share this post


Link to post
Share on other sites

There was a similar bug, but found and fixed about a year ago so it should still be among the regression tests.  You can search the bug database to see if your specific variation exists.

I suspect yours is as designed since it switches when you start the player and reverts back once you stop the player.  You're generally not supposed to scale in the way you describe.

 

When the scale level is 0.28 I see the whole game like in any other normal project, but when the scale level is 1 it looks like I look at my game with a magnifying glass. I don't understand why the default scale is not 1 in my project.. maybe it's a problem with the project itself, I don't really know.. I will send a bug report soon. Thanks for your help, I appreciate it very much.

Share this post


Link to post
Share on other sites

when the scale level is 1 it looks like I look at my game with a magnifying glass.
So the Game View window is set to us a much higher resolution than your native display. 

On the control bar, what settings do you have for the display? Is it set to a specific resolution, free aspect resized to the window, or something else?

Also, if you are on a mac, is the "Low Resolution Aspect Ratios" box checked?

Share this post


Link to post
Share on other sites

 

when the scale level is 1 it looks like I look at my game with a magnifying glass.
So the Game View window is set to us a much higher resolution than your native display. 

On the control bar, what settings do you have for the display? Is it set to a specific resolution, free aspect resized to the window, or something else?

Also, if you are on a mac, is the "Low Resolution Aspect Ratios" box checked?

 

 

A specific resolution 1920x1080.  Also my native display is 1920x1080. 

When I choose 16:9 and not a specific resolution then the scale level starts from 1  :wacko:. 

Share this post


Link to post
Share on other sites

A specific resolution 1920x1080.  Also my native display is 1920x1080. 

The game view is meant to be a preview of what the game actually looks like. It is not typical to have it be the same size as your full screen. 

My recommendation is you set it to a fixed aspect ratio instead of a specific pixel size. 

Otherwise, yeah, you're going to struggle with it since you're doing things differently than people usually use it.  Even if it is a bug, that makes it a low priority and it is unlikely to get fixed if you're a rare use case.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this