Resolution Switch In Game Not Working Properly

I am trying to change the resolution in my game.

I want may game to start on a given resolution defined in Script and after that as per user input,
But when i do that my screen just go black and nothing happen a prat from the size of my windowed game changes.
I have been searching for this but i am not been able to find a solution for what i am experiencing, everything just stuck and i dose not move at all

This is the code i am using

This is where my resolution is being set on play

void Awake()
	{
        resolutionPopup.value = "1024x768";
        SetResolution("1024x768", false);
        graphicsPopup.value = "Fantastic";
        SetQuality(5);
	}

this is where It gets the supported resolutions and add them to my popup window

void Start () {
    
        GetRes();
        GetQuality();
        NumberOfMonitors();
        Debug.Log("Start");

	}

this is where i am getting all suported resolutions of monitor

void GetRes()
{
    Resolution[] resolutions = Screen.resolutions;
    foreach (Resolution res in resolutions)
    {
    
        string resolution = res.width.ToString() + "x" + res.height.ToString();

        SetDropDowmResolution(resolution);
    }
}

this is the method which sets the resolution in to popup

void SetDropDowmResolution(string res)
{
    resolutionPopup.items.Add(res);
}

this is where my selected resolution is being set

 void SetResolution(string res, bool fullscreen)
{
    string[] resBreak = res.Split('x');
    Vector2 resV2 = new Vector2(Int32.Parse(resBreak[0]), Int32.Parse(resBreak[1]));

    Screen.SetResolution((int)resV2.x, (int)resV2.y, fullscreen);

   
}

i am using Set Resolution Method GUI button
Plz look into this matter as i am unable to solve it…
Thanks

Does the same thing happen if you set the resolution in the player settings, but then later try to change it via code? It shouldn’t matter, but maybe it does and maybe you need to set the supported orientations. I use this method in my Mobile Store Screenshot Helper asset that does this, I just built it with Unit 5.3.4p5 and it works 100%.

So I can only assume that there’s an error in your code (I’d check those values you’re actually setting the resolution to) or it’s some conflict with the Player Settings. Attaching screencaps of mine in case it helps.