- Home /
Unity freezes when settings QualitySettings.VSyncCount = 0
Hello!
I am having a weird issue, whenever I try to change the value of the VSync through code, my game freezes entirely and stops responding
I am using Unity 2020.3.24f1, and here is my simple lines of code :
public void SetVsync()
{
PlayerData.GetInstance().Vsync = !PlayerData.GetInstance().Vsync;
if (PlayerData.GetInstance().Vsync) QualitySettings.vSyncCount = 1;
else QualitySettings.vSyncCount = 0;
}
If I click the button once, the VSync will be enabled, but if I press the button again, that's all, the app freezes ... I really don't get it, this isn't my first game like I am not dumb this should work
PlayerData is my player settings class, I am using a singleton to modify the variables Vsync is a boolean The method is called when a button is pressed, I checked, there are no infinite loops, and it freezes ONLY when the VSync is set to 0
Edit : I am on a MacBook Pro M1, and this happens in the built game, nothing happens in the editor
Answer by KloverGames · Jan 08 at 11:07 AM
u figure it out yet or..?
Nope … :( I disabled the button until I have a solution :( I didn’t try on windows / cannot since I only have my macbook, have you ever had this issue ?
Your answer
Follow this Question
Related Questions
SceneManager.LoadScene causes total freeze 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers