Search Unity

Video Using QualitySettings.SetQualityLevel is very slow taking 10 seconds to update why ?

Discussion in 'Audio & Video' started by DubiDuboni, Sep 14, 2019.

  1. DubiDuboni

    DubiDuboni

    Joined:
    Feb 5, 2019
    Posts:
    131
    I'm creating a main menu.
    In the Hierarchy on the Canvas attached this script :

    Code (csharp):
    1.  
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine;
    5. using UnityEngine.Audio;
    6.  
    7. public class SettingsMenu : MonoBehaviour
    8. {
    9.     public AudioMixer audioMixer;
    10.  
    11.     public void SetVolume(float volume)
    12.     {
    13.         audioMixer.SetFloat("Volume", volume);
    14.     }
    15.  
    16.     public void SetQuality(int qualityIndex)
    17.     {
    18.         QualitySettings.SetQualityLevel(qualityIndex);
    19.     }
    20. }
    21.  
    Then in he Hierarchy on the Graphics (dropdown ui) I scrolled down and dragged the canvas and selected Dynamic int SetQuality method.

    This screenshot show the Canvas with the script attached to it :



    And now a screenshot of the Graphics Inspector settings :



    Now when running the game I opened the Edit > Project Settings... > Quality to see in real time the changes when changing in the game the Graphics level settings :

    Then changed it to LOW and it took about 5-7 seconds to change it to Low sometimes it might taken even more time to change almost 8 seconds more or less.

    I can't figure out why it's taking so much time to change it.

    A screenshot after changed to LOW and it didn't change it Low in real time it's taking a lot of time :