title: "SetDestination" can only be called on an active agent that has been placed on a NavMesh - After destroying Enemy
body: <p>I have a NevMeshSurface with Enemies. All Enemies have a NevMeshAgent. </p>
  
  <p>When the Player dies, all Enemies should get destroyed:</p>
  
  <pre><code>GameObject[] enemies = GameObject.FindGameObjectsWithTag("Enemy");
  foreach (GameObject enemy in enemies)
  {
      Destroy(enemy.gameObject);
  }
  </code></pre>
  
  <p>When this happens, i get the error: </p>
  
  <blockquote>
    <p>"SetDestination" can only be called on an active agent that has been
    placed on a NavMesh.</p>
  </blockquote>
  
  <p>This is the Enemy Script: </p>
  
  <pre><code>public GameObject player;
  NavMeshAgent agent;
  
  void Start()
  {
      agent = GetComponent&lt;NavMeshAgent&gt;();
      agent.Warp(transform.position);
  }
  
  void Update()
  {
      if (player.gameObject != null &amp;&amp; gameObject.activeSelf)
      {
          agent.SetDestination(player.transform.position);
      }   
  }
  </code></pre>
  
  <p>The NevMeshSurface is baked when the Enemies are spawned. </p>
  
  <p>And it works great, until the player dies, then the error appears and i don't know how to solve this. </p>