title: How to use SetActive()
body: <p>I'm trying to create a registration scene. I want to show three panels when the user enters an invalid name, email, and/or password. I have the panels hidden at start. That works. However, the panels don't show up when I enter invalid info and click the button. When <code>validName</code>, <code>validEmail</code>, and <code>validPassword</code> are false, it goes into ShowNamePanel() and gets stuck. </p>
  
  <p>What's wrong with my code?</p>
  
  <pre><code>public GameObject namePanel;
  public GameObject emailPanel;
  public GameObject passwordPanel;
  
  public void Start ()
  {
      HideNamePanel ();
      HideEmailPanel ();
      HidePasswordPanel ();
  }
  
  public void ButtonClick ()
  {
      Debug.Log ("1. Button clicked.");
  
      CreateUser ();
  }
  
  /*
   * Sends post request to create new user if name, email, and 
   * password are valid.
   */
  
  public void CreateUser ()
  {
  
      validName = IsValidName (username);
      validEmail = IsValidEmailAddress (email);
      validPW = IsValidPassword (password);
      //validNewUserCombo = IsValidNewUserCombo (email, password);
  
      if (validName &amp;&amp; validEmail &amp;&amp; validPW) {
          Debug.Log ("6. VALID INPUTS");
          CallAPI ();
      } else {
          Debug.Log ("8. INVALID INPUTS");
          if (validName == false) {
              ShowNamePanel ();
          }
          if (validEmail == false) {
              ShowEmailPanel ();
          }
          if (validPW == false) {
              ShowPasswordPanel ();
          }
      }
  }
  
  public void ShowNamePanel() {
      Debug.Log ("shownamepanel");
      namePanel.SetActive (true);
  }
  
  public void HideNamePanel() {
      namePanel.SetActive (false);
  }
  
  public void ShowEmailPanel() {
      Debug.Log ("showemailpanel");
      emailPanel.SetActive (true);
  }
  
  public void HideEmailPanel() {
      emailPanel.SetActive (false);
  }
  
  public void ShowPasswordPanel() {
      Debug.Log ("showpasswordpanel");
      passwordPanel.SetActive (true);
  }
  
  public void HidePasswordPanel() {
      passwordPanel.SetActive (false);
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/C4reY.png" rel="nofollow noreferrer">Connecting variables in the Inspector</a></p>
  
  <p><a href="https://i.stack.imgur.com/YalyD.png" rel="nofollow noreferrer">Panel hirearchy</a></p>