Changing V-SYNC count doesn't change it in quality settings

Hi,

So I’m making an options menu for my game, but for some reason, changing the VSYNC count doesn’t actually change it in the settings. I have no errors, or anything so I’m really confused why it’s not working. I have a toggle switch button that cycles between ON/OFF with the VSYNC count of 0/1. I don’t know if I’m stupid or what’s going on so I need someone else to take a look at this. Many thanks!

Script for the button:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class toggleVSync : MonoBehaviour
{
    public Text textToChange = null;
    public int counter = 0;

    public void changeText()
    {
        counter++;
        if (counter % 2 == 1)
        {
            QualitySettings.vSyncCount = 0;
            textToChange.text = "V-SYNC: OFF";
        }
        else
        {
            QualitySettings.vSyncCount = 1;
            textToChange.text = "V-SYNC: ON";
        }
    }
}

What do you mean by “change it in the settings”? Do you mean you don’t see the change in the quality settings window? Cause I don’t think it’s supposed to do that. As far as I know, the quality settings window just displays “presets”.

The settings shown in the inspector are the settings your app starts with. Changing the settings here via API changes the runtime settings, not the defaults you can see in the inspector. It’s like making a modification during Playmode not being retained when you leave Playmode.

1 Like

Yes, and it displays a bunch of other settings as well.

Some guy was able to do that though?

So is your goal to change the defaults?