Deactivate game modes until tutorial is finished?

Hello, Unity community.

So I’m building a simple game demo, and I have a main menu with three buttons; two game modes and a tutorial. I want the tutorial to be required before playing the other game modes.

How would I tell my gameManager (empty game object that handles pausing at the moment, and other things in the future) whether the tutorial has been played, and to set the other two buttons to SetActive(false) if it hasn’t? I tried FindGameObjectsWithTag but that apparently puts all the gameObjects in an array, and SetActive doesn’t work on arrays.

Thanks in advance :slight_smile: I use C# only by the way

You could store references to your GameMode-Buttons in the GameManager:

[SerializeField]
Button[] gameModeButtons;

In the editor’s inspector, set array’s size to 2 and drag the two buttons in.

Make sure the two Buttons are not set to interactable by default.

Then in your GameManager, once it is informed that the Tutorial has been completed, execute:

foreach(Button b in gameModeButtons) {
	b.interactable = true;
}