My panel dont close

I’m trying to make a button that closes the hack_panel but it didn’t work
my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Level1_Controller : MonoBehaviour {
    //Variables
    public Button Hack;
    public Button Develop;
    public Button Research;
    public Button SQ;
    public GameObject Hack_Panel;
    public bool isOpened;

	// Use this for initialization
	void Start () {
        isOpened = false;
        Hack.onClick.AddListener(Goto_hack);
        Develop.onClick.AddListener(Goto_develop);
        Research.onClick.AddListener(Goto_research);
        SQ.onClick.AddListener(Goto_sq);
    }
	
    public void Goto_hack() {
        if(isOpened == false) {
            Hack_Panel.gameObject.SetActive(true);
        } else {
            Hack_Panel.gameObject.SetActive(false);
        }
        
    }

    public void Goto_develop() {

    }

    public void Goto_research() {

    }

    public void Goto_sq() {

    }
	// Update is called once per frame
	void Update () {
        Goto_hack();
        Goto_develop();
        Goto_research();
        Goto_sq();
	}
}

Hey, have you solved this yet?

If not it looks like your problem is with the ‘isOpened’ boolean. In this script you set it to false on default but you never set it to true, unless you do this from another script.

Try changing your code in the Goto_hack function to:

     public void Goto_hack() {
         if(isOpened == false) {
             Hack_Panel.gameObject.SetActive(true);
             isOpened = true;
             return;
         } else {
             Hack_Panel.gameObject.SetActive(false);
             isOpened = false;
             return;
         }
         
     }

Hopefully it helps!