Disabling part of an event system?
I want a pop up window to appear and the underlying buttons to not be accessible anymore unless you close the popup. Here is a 30 second video that makes it obvious what my problem is. I did try to add another event system but that didn't work, so how is it done? https://www.youtube.com/watch?v=kzfkmNjuGes
Answer by djordr · Apr 27, 2018 at 04:56 PM
I figured out how to do it, you have to access each button and set interactable to false. You also have to set the currently selected button to be the new UI button. Here is the script:
public void SettingsButton()
{
eventSystem.GetComponent<UnityEngine.EventSystems.EventSystem>().SetSelectedGameObject(volume);
startButton.interactable = false;
continueButton.interactable = false;
settingsButton.interactable = false;
leaveButton.interactable = false;
canvas2.SetActive(true);
canvas3.SetActive(true);
canvas4.SetActive(true);
}
Note that you might also have to make a reference to the UnityEngine.UI at the top where all your namepspaces are at.
using UnityEngine.UI;
Your answer
![](https://koobas.hobune.stream/wayback/20220612161609im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Buttons Selected Color is not active when said button is set as selected via SetSelectedGameObject 1 Answer
Unity automatic UI navigation events get messed up after entering playmode 0 Answers
How to make a UI Image appear/disappear? 2 Answers
Problem in disabling button and error in the statement 0 Answers
Hide/Disable a Dropdown 1 Answer