Standalone player default window size?

I’m just learning Unity (after several failed attempts in the past).

Am going through the Unity tutorials, and got fixated on this issue:

When trying to build to a standalone exe/player, how do I set the default window size (for Windowed mode)?

I.e, 400 x 600 for a small, windowed game?

Here’re the settings of my Player:

I tried searching the Unity forums, and the closest solution I found was to use Screen.SetResolution().

But whichever GameObject.Start() I attach the script to will be executed too late.

ie, the Unity splash screen starts off at a huge window size, before shrinking to the size I want when my scene is finally loaded.

At the moment, this is still a trivial issue for me, albeit a rather irksome one.

Would appreciate some help and guidance.

Thanks!

Ah, found it! Here’s what’s happening:

In the Player settings:

By default, both “Default Is Full Screen” and “Default is Native Resolution” are ticked.

Because I wanted a “windowed” game, I first unticked “Default Is Full Screen”.

This causes:

  1. The Default is Native Resolution to disappear
  2. Default Screen Width/Height text boxes to appear

Turns out, I had to untick the “Default is Native Resolution” checkbox before the “Default is full screen”. ie, before it disappears.

Since Unity hid the Native Resolution option after I unticked the full screen option, I thought it was not relevant for windowed mode. Turns out it was!

Are you sure? Unticking “default is native resolution” does nothing for me. I’m having the same problem and what I think is happening is that the settings are only the DEFAULT settings, when you start the program for the FIRST TIME. But once you started it at a size of 1600x900 and then change it in the player settings to 500x500 it just doesn’t do anything anymore, since the actual window size has already been saved as 1600x900 SOMEWHERE. I don’t know where but it definitely gets saved somehwhere, try checking “resizable window”, rebuilding, resizing the window and reopening it. The window size has been memorized, but I have no idea in which file and how to clear the settings. So the only solution for me right now if I want to change the window size is to set “resizable window” to true, then starting the game, resizing the window with the mouse and closing it. But of course this way you can’t set a specific size. Really really stupid if you want to change the window size after starting it for the first time, it’s just not possible unless we somehow find out where unity stores the player settings and then clear them.

Edit: Deleting PlayerPrefs with PlayerPrefs.DeleteAll() seems to work even though I can’t find any setting related to window size in the registry!?!