Problem forcing a resolution

Hi everyone,

I have an issue with setting my player’s resolution.

I’ve built a pixel art game and only plan on supporting 1920x1080.

However, players can still run the game on smaller resolutions. It plays badly - sprites jitter and the screen cuts off elements. I expect this.

Is there some way I can either force them to 1920x1080 or just prevent them from playing?

I’ve tried Screen.SetResolution and that just instantly crashes my build no matter what resolution I’m running, even though there are no compiler errors. (I’ve attached it to a game object in my first scene). I’ve also attached my Player Settings, which I’ve tried both with the script and without.

using UnityEngine;

public class ExampleScript : MonoBehaviour
{
    void Start()
    {
        // Switch to 1920x 1080
       Screen.SetResolution(1920, 1080, true);
    }
}

alt text

In Resolution and Presentation under Player settings, disable Display Resolution Dialog, and make sure to set the default resolution to whatever you want it to be.