title: Unity - Whats the Opposite of instantiate - Transform not destroying
body: <p>I an trying to destroy prefab1 below ( destroying its game object) in update but the prefabs do not get removed in my game. DESTROYING HOLE 1 GEMS debug below appears in console and gameobject is destroyed but the gems (prefab sprite) do not get removed from my game even when gemCount_Hole1 is less than 1 . Please help</p>
  
  <pre><code>            if (gemCount_Hole1 &lt; 1)
          {
              Debug.Log("DESTROYING HOLE 1 GEMS");
              if (prefab != null) Destroy(prefab.gameObject);
          }
          else
          {
              for (int i = 0; i &lt; gemCount_Hole1; i++)
              {
                  Instantiate(prefab, new Vector3((i + xPos_Hole1) * 2.0F, -14, 0), Quaternion.identity);
              }
          }
  </code></pre>
  
  <p>I created a list but dont know how to write the destroy. Here is how I coded it as a list</p>
  
  <pre><code> private System.Collections.Generic.List&lt;GameObject&gt; list ; 
   void Start()
   {
    list  = new System.Collections.Generic.List&lt;GameObject&gt;();
   } 
   void Update()
   {
    for (int i = 0; i &lt; gemCount_Hole1; i++)
    {
     list .Add( Instantiate(prefab, new Vector3((i + xPos_Hole1) * 2.0F, -14, 0), Quaternion.identity)) ;
    }
   }
  </code></pre>