Get the screen resolution for full screen mode?

This may be very simple, but I am not quite sure how to do this…

When my game starts, it defaults to full screen mode, which is what I want, but it doesn’t choose the correct screen resolution on the different computers I test it on. Is there a way to auto detect the screen resolution on start up of the game, and have the best option checked already in the options so that the user doesn’t have to think about that?

Thanks!

You can use Screen.resolutions (see documentation) to retrieve the highest resolution and change it with Screen.SetResolution().
But I would not do that automatically because the highest resolution always ends with the slowest performance!
Implement a feature that allows the user to change the screen resoluation manually or use the player settings to display the screen resolution dialog when your app starts.