title: Adding multiple cubes in Unity
body: <p>My Unity game needs to insert multiple cubes at the start. These positions will be random each time. I am fine with the positioning of them and everything however I can only insert one cube without an error.</p>
  
  <pre><code>GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
  cube.transform.position = new Vector3(0, 0, 0);
  </code></pre>
  
  <p>This code works fine to insert one cube however when I repeat the same TWO lines afterwards it comes up with an error because the variable 'cube' is already defined. I could insert them one by one with different variable names each time however this would be inefficient. I have tried clearing the variable 'cube' so I can then insert a second cube but I still got an 'already defined' error:</p>
  
  <pre><code>GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
  cube.transform.position = new Vector3(0, 0, 0);
  cube = null;
  GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);\
  cube.transform.position = new Vector3(1, 0, 0);
  </code></pre>
  
  <p>Does anyone know how to insert a cube an unlimited amount of times without needing to change the variable name?</p>
  
  <p>Thanks.</p>
  
  <p><strong><em>Note, my code is under void Start()</em></strong></p>