SetActive(false) not working

for some reason, this script doesn’t work, I have it set to disabled at start and when the value appears it enables and there is a button to disable it, but the button just doesn’t do anything. I have it all set up but the button just doesn’t do anything.

here’s my code:

    public Slider sl;
    public GameObject w;
    
    void Update()
    {
        if (sl.value >= 194) { w.SetActive(true); }
    }
    
    public void close()
    {
        w.SetActive(false);
    }

Hope this is what you want.

void Update()
{
    if(sl.value >= 194)
    {
        w.SetActive(true);
    }
    else
    {
         w.SetActive(false);
    }
}