Search Unity

How do I make my menu show when I start the game?

Discussion in 'Scripting' started by mllhild, Mar 8, 2020.

  1. mllhild

    mllhild

    Joined:
    Apr 30, 2018
    Posts:
    3
    I have a Canvas with the scrip.
    Nested into the Canvas are 4 GameObjects: Background, MainMenu, LoadMenu, Options
    Inside of each is a ready build and working menu.
    All start with the little box besides their name in the Inspector unchecked.
    So when I press play in the editor only a black screen appears.

    How do I make the MainMenu appear? (Aka: how do I check the box in the Inspector with C#)

    Im now 3 hours and a number of videos and help files in, without any success.

    I discovered that if I put script into the MainMenu and write
    Code (CSharp):
    1. gameObject.SetActive(false);
    I can make it vanish, but the opposite doesnt work since the MainMenu isnt even ?instantiated? at game start.