title: Foreach child in GameObject add child to list, adds more than it should
body: <p>So my code right now</p>
  
  <pre><code>void UpdateList()
  {
      foreach (Transform child in gameObject.transform) if (child.CompareTag("Food"))
      {
          FoodList.Add(child.gameObject);
      }
  }
  
  void EnableFood()
  {
      UpdateList();
      foreach (GameObject Food in FoodList) if (Food.CompareTag("Food"))
      {
          Food.gameObject.SetActive(true);
          Food.gameObject.GetComponent&lt;Food&gt;().Claimed = false;
      }
  }
  </code></pre>
  
  <p>What I have is the list of childs with the tag <code>Food</code>, this list is part of a "Farm".  Players can interact with the food in the farm, if a player collides with the <code>Food</code> object, that child gets removed from the list and set to inactive. And 20seconds later it gets set to active again to make it act like the food is respawning.  </p>
  
  <p>The problem with the code is that when I do <code>FoodList.Add(child.gameObject);</code> It doesn't add just the amount of childs in the parent, it adds way more.<br>
  From default there are 8 childs, when i run the method <code>UpdateList()</code> it adds 28.</p>
  
  <p>--Edit showing what happens from start to end.</p>
  
  <pre><code>public List&lt;GameObject&gt; FoodList = new List&lt;GameObject&gt;();
  void Update()
  {
      UpdateList();
  }
  
  void UpdateList()
  {
      foreach (Transform child in gameObject.transform) if (child.CompareTag("Food"))
      {
          FoodList.Add(child.gameObject);
      }
  }
  //At this point the list already has 14 objects in it.
  //(Also made some minor changes that I made because I was frustrated the code didnt work..)
  
  //Right now I have my parent GameObject
  //that contains 8 childs with the tag Food in the editor.
  
  //Now were moving to the Player his script.
  void OnTriggerEnter(Collider Object)
  {
      if (Object.gameObject.tag == "Farm")
      {
          Farm = Object.gameObject.transform.parent;
          FoodListPlayer = Farm.GetComponent&lt;FoodSpawn&gt;().FoodList;
      }
  }
  
  //Here the collided object Food is set to inactive and removed from the list.
  void OnCollisionEnter(Collision Object)
  {
      if (Object.gameObject.tag == "Food")
      {
          Object.gameObject.SetActive(false);
          FoodListPlayer.Remove(Object.gameObject);
      }
  }
  </code></pre>
  
  <p>I think that with the foreach loop it only adds as many childs as there are in the parent and that it stops adding if every child is in the list, that is probably what is going wrong on my end right now..</p>