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";
}
}
}