title: Unity can't find my reference of an Input field
body: <p><strong>I am pretty new to Unity and game development so sorry if this is a stupid mistake.</strong></p>
  <p>I am trying to create a UI in which you enter text into a input field (TMP), the script will check the input and if it reads &quot;password&quot;, a Debug.Log is shown in the console.
  I have looked around online for any help with this but nothing seems to work.
  I have got a script that I assume to work, but I am getting one major problem: On line 15 it cant find the Input Field that I am trying to reference?</p>
  <p>The script is attached to the Input Field, I am trying to reference it from there.</p>
  <p>Any help would be greatly appreciated... Thanks!</p>
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  using UnityEngine.UI;
  
  public class CheckPassword : MonoBehaviour
  {
      
      public InputField inputField;
  
      public void Awake()
      {
          inputField = GetComponent&lt;InputField&gt;();
      }
  
      public void CheckInputField()
      {
          if (inputField.text == &quot;password&quot;)
          {
              Debug.Log(&quot;Password Correct&quot;);
          }
      }
  }
  </code></pre>