title: How do I fix this "<name> is declared but never used" error?
body: <p>I have this code:</p>
  <pre><code>using UnityEngine;
  using UnityEngine.SceneManagement;
  public class GameManager : MonoBehaviour
  {
      bool GameHasEnded = false;
  
      public void EndGame()
      {
          if (GameHasEnded == false)
          {
              GameHasEnded = true;
              Invoke(&quot;Restart&quot;, 2);
              Debug.Log(&quot;LOSER!!!  you DUMB&quot;);
              
          }
  
  
      void Restart()
          {
           SceneManager.LoadScene(SceneManager.GetActiveScene().name);
          }
      }
  }
  </code></pre>
  <p>When I try to compile it, I get the error: &quot;cs8321  restart is declared but never used&quot;. Why does this occur, and how can I fix it?</p>