I have this code for toggling my optionsmenu but it only works when hiding the menu.
In // I had another way that didn’t work either so I went for the if else statements but that gave me the same result. I would rather have “optionsMenu.SetActive(!optionsMenu.activeSelf);” work, but I’ll take any solution at this point.
Sorry if it’s a dumb question I’ve just started coding in C#
void Update() {
if (Input.GetKeyDown(KeyCode.Escape)) {
if (optionsMenu.activeInHierarchy == false) {
optionsMenu.SetActive(true);
}
else {
optionsMenu.SetActive(false);
}
//optionsMenu.SetActive(!optionsMenu.activeSelf);
}
}