Set windowed mode default size

I am trying to build a version for windows that runs in windowed mode. I would like to be able to set the default width and height for the window. However no matter what I do, the window is always created at the maximum resolution of my display. I have the following settings:


It seems like there must be something obvious that I am missing.

Any help would be appreciated.

One you have startet the application at a resoltuon the application saves the resolution on the systhem and will start with it the nextime so your default with / height are ignored.

Thanks for the info, but where exactly is this information stored. I tried deleting the entire build folder and rebuilding the project, but the window still starts at the size of the current screen resolution.

On windows its stored under the windows Registry (regedit.exe)
Computer\HKEY_CURRENT_USER\Software\CompanyName\ApplicationName

Ok, found it. Thanks for the help.

Ok, now I am having trouble with this on the Mac. When I first installed the app, the screen was the correct size. However, I made the mistake of clicking the window’s maximize button (this button is disabled on the Windows version). This resulted in a window that was the incorrect size and now the app is stuck in that size even if I close it and restart it. Is the window size stored somewhere like it is for Windows?

Thanks

Any way to let Unity ignore the registry-saved windowsize and open the app with a windowsize that I define?

The command line parameters don’t work?
https://docs.unity3d.com/Manual/CommandLineArguments.html

1 Like

Didn´t know about this and it works, thanks!

I did this by editing the shortcut>target:
…myApp.exe -screen-fullscreen 0 -screen-width 800 -screen-height 400

Any way to implement this directly in the editor?

https://docs.unity3d.com/Manual/BuildPlayerPipeline.html

After all, I´m not happy with my solution to add -screen-fullscreen 0 -screen-width 800 -screen-height 400 to my shortcut.
This way I can´t send it to my clients, because the path inside my shortcut is hardcoded and of course its different on my clients pc.

Any better idea?

Cascho01 nice solution, it is also possible to use Unity Editor: Edit->Project Settings…
and then select “Player” from left pane and see “Resolution and Presentation” change it to windowed mode.

When changing the project settings in Visual Studio 2019, it seems that Visual Studio takes the precedence and it cannot be reverted