What is wrong with this code? (423120)

Hello guys,

I added the below code to a object in my start screen, but it doesn’t work. I am in a PC, windows xp. Could someone tell me what is wrong with this code? It doesn’t change the resolution when I start the game!

My goal is for the game to go fullscreen directly ( which it does) and change the resolution of the player to the same resolution that the computer is setted to( this is what it fails to do).

function Awake(){
Screen.SetResolution(Screen.currentResolution.width, Screen.currentResolution.height, true);
}

Regards,
Carlos

screen will give you the resolution of the player, not the system

Thanks for your response.

When I debug: print(currentR.width; from that code, it gives me the resolution width I am using on my monitor so I thought that it was giving me the actual resolution of my monitor…

Is there a way to change the resolution of the player to the one set in the user computer automaticaly? so that my app takes the same resolution user computer?

Thanks!
Carlos

Hello guy,

I just solved this.

The trick is to not start the player in fullscreen and just before the first level loads(welcome screen) it will jump to fullscreen mode with the exact resolution of the user machine without any distortion at all.

Hope this helps someone.

Regards,
Carlos.