Problem in Unity commandLine, change height and width with commandline.

Hello Guys,

I made one .exe with following player setting:

1.Player Height : 1024 Width : 768.

2.Default is fullscreen : true.

3.RunInBackground : true.

Now my question is can i change Height and width of player with commandline argument. Unity Document shows there is commandline for that “-screen-width -screen-height”. Now according document i made one batch file to launch a unity exe with some other resolution. But its not working. Batch file code is as below:

@echo off
“%~dp0test.exe” -screen-width 1280 -screen-height 720
exit

When i run the batch file its not override the resolution, but document said that -screen-width is just override the screen width.

Can anyone tell what i m doing wrong here.

OR in fullscreen mode you can not change screen height, width with the help of commandline.

Thanks in Advance.

Bump…

Please any one, any suggestion?..

Here is solution according my requirement:

In player setting i changed width and height with 2048x1080 with unchecked default fullscreen and disabled resolution dialogbox.

I made one .bat file to launch unity made .exe in chromeless windows (fakefullscreen). So that .exe got fitted according user resolution.

same problem here, those arguments dont seem to work at all.

I need this too. Why doesn’t it work?

You can parse Environment.GetCommandLineArgs yourself and use Screen.SetResolution

You need this for Mac player anyway since only Win/Linux are documented to support -screen-width