Unity Mac App not respecting Player Settings width/height aspect ratio

Hi all!

TL;DR:
Our Mac client is not respecting the aspect ratios or width/height we set in Player Settings.

DETAILS:
Mac OS X dev machines, some on Lion (10.7), one on Mountain Lion (10.8). One machine (the Mountain Lion one) shows different width/height choices for our game when opened with the dialog. In the Player Settings, we check ONLY the 16:9 option (our game layout requires that aspect ratio, and things go offscreen when it’s not respected). We’ve also set a default size that is 16:9.

However, when I open the game on the Mountain Lion (ML) machine, it is presented only with a single 16:10 ratio and size to start the game windowed - and the size is the full size of the screen (1680X1024).

If I hook the ML machine up to a Cinema display, it is presented with a much larger option (25x16 or something - again, the full size of the display), which again, is not 16:9. Again, why couldn’t it give me just plain ol’ 1600x900?

Why won’t it let me choose any arbitrary smaller size?
Why won’t it respect the 16:9 limitation we specified in the project?
Why does it matter what the aspect ratio of the monitor, when the requested size is much smaller?
Where does Unity store the ‘last run’ size?

The machine giving problems has two differences:

  1. Mountain Lion vs. Lion (I HIGHLY doubt that’s a problem)
  2. In the Unity Editor, I believe it erroneously had 16:10 specified in the Game window.

I think the latter is the problem - that somehow because the Editor “Game Window” has 16:10 specified, that is getting confused into the situation somehow.

One final weirdness: This morning, I had a developer build me a new executable on one of the Lion machines (on which it’s working). I copied it to the ML machine, and the first time I ran it, it DID open in 16:9 ratio!!! Yay! Only it was a little small (800X450?) So I chalked it up to “the problem is with apps that are built on this machine”. I re-ran it with Option held down to (hopefully) pick a larger - but still 16:9! - resolution. And once again, I was presented only with the choice of 1680x1024 - full screen, wrong aspect ratio.

So it has to do with running them on THIS machine.

What could be polluting it? Running the same app (regardless of where it’s built - we tried exporting in both directions) will work on some machines (iMacs), but not on the MacBook Pro.

Thoughts?

THANK YOU!
Aaron

I’d like to hear some wisdom on this topic too, as I see the same behaviour all the time on my Macs. Even on PC I see inconsistent behaviour, where we’re building for a specific non-standard screen resolution (windowed in desktop builds) and it can’t display that at all; it always goes to the closest preset resolution (regardless of allowable aspect ratio settings).

Hi Pix10 -

Oh, you can’t imagine what a relief it is to hear I’m not going crazy here. Man, I thought it was just me!

Did you try anything I didn’t? Any others ideas of what might be causing it?

Ok, this is a total GFH*, but whatever. I need to demo this next week, and I need a solution.

If you open a terminal window, you can check the Mac OS defaults to see where it’s written the bad value. I haven’t found out how to fix it to the resolution I want, but I can at least get it to reset to the 16:9 that was working on first launch.

WARNING: Playing with the Defaults on Mac OS is like messing with your Registry in Windows. User assumes all risk from this point on:

Open a Terminal window, and type “defaults read”. Scroll up until you find an entry that says ‘unity..’. Here’s ours:
“unity.voidALPHA.StormBound” = {
“Screenmanager Is Fullscreen mode” = 0;
“Screenmanager Resolution Height” = 576;
“Screenmanager Resolution Width” = 1024;
};

I tried writing my own values in there, via:
defaults write unity.voidALPHA.StormBound “Screenmanager Resolution Width” 1600
defaults write unity.voidALPHA.StormBound “Screenmanager Resolution Width” 900
but it doesn’t fix anything - in fact, the next time I launch, it comes up in 1024x768 - where the hell did THAT come from? Apparently when you open the app and it finds a mismatch (the defaults tells it one thing and maybe a resource.asset in the package says something else), it probably resorts to what it thinks is a safe aspect ratio / resolution. The problem is, NOTHING in the project is telling it that that’s a safe aspect ratio.

Also, once I open the Resolution window on startup, additional keys get written to the defaults, and again, I haven’t figured them out, but there you go.

The one thing that did work is to:
defaults delete unity.voidALPHA.StormBound
which removes that key, causing it to reset to the original 16:9 resolution we specified in the Unity → Project Settings → Player settings.

What gives, Unity?!

  • I originally thought this was common lingo, but google says no. Guess it’s local. I saw it in someone’s comments once, and it stuck. “This is a total goat-“f”-hack”.
1 Like

Bump. Any solutions to this problem?

Unity can only use resolutions that actually exist on the machine, it can’t create new ones (except in windowed mode). On Mavericks, stuff in ~Library/Preferences is cached, so if you trash the plist file, the simplest thing to do is log out and back in again.

–Eric

I get the same issue even when windowed.

Bumping this, as I have the same issue in windowed mode. Quite frustrating!

This is still an issue in Unity 5.2.2. It respects the aspect ratio settings on Windows but not Mac. I need it to display in 4:3 regardless of the screen size and pillar-box the window with black bars. Instead, it always stretches fullscreen on Mac.

UPDATE: I switched to Capture Display mode for Mac fullscreen and this solved (or at least worked around) the issue. However, I still would like to be able to allow for app switching with the player constrained and pillar boxed in normal fullscreen mode. Since this works on Windows, I have to assume it’s a Mac bug.

Sounds like it might be worth submitting a bug about this.

Hi,

Solution here: Why doesn't Standalone Build Resolution settings affect the standalone size - Questions & Answers - Unity Discussions

You need to wipe the playerprefs. Somehow Unity picks up what’s in the prefs rather than the current settings…

Bye,

Jean

I believe that their focus is to have Unity support as many platforms as possible. That’s the main goal. It’s not to have Unity run perfectly on every platform, that’s what native is for.

Unity 2019.2.8f1 here, and still having the same problem. I need my app to start in 4:3, here are my settings, but still, macOS offers me to start on 3840 x 2160… Even ignoring my default height width of 2000x1500.

I’ve tried all combinations, solutions above, and I also tried this and this… none of them did work, my app still start in 16:9.
Has anyone managed to get the aspect ratio somehow working on macOS?

same issue, any solution?

it ignores my values.