title: Trouble with missing Reference after gameObject is destroyed
body: <p>In my game, the npc is suppose to attack and destroy a house, which is assigned as a target on the script, but when the house is destroyed, an error says that there's a missing reference, which i expected to happen...</p>
  
  <p>But how can I fix this? Is there a way to disable the target variable after the gameObject is destroyed?</p>
  
  <p>this piece of code is on the npc script</p>
  
  <pre><code>void Start () {
  
      force = 1000;
      enemyHealth = 100;
      enemyAttack = 20;
      enemyDefense = 2;
      bigFont= new GUIStyle();
      bigFont.fontSize = 20;
  
      target = GameObject.FindGameObjectWithTag("Player").transform;
      targetHouse = GameObject.FindGameObjectWithTag("house").transform;
  
  
  
      animator = GetComponent&lt;Animator&gt;();
  }
  </code></pre>
  
  <p>this is on the house script</p>
  
  <pre><code>void Update () {
      if(houseHp&lt;= 0){
          Destroy(GameObject.FindWithTag("house"));
      }
  }
  </code></pre>