title: Unity: Landscape Generation Stops after a while
body: <p>I am building a scrolling game. The camera is set to scroll at a set speed. There is a trigger gameobject connected to the camera that is destroying all the land blocks it creates and tells the landscape to create the next line. This work great but after a small amount of time it just stops creating lines. My thoughts are there's a world size I need to change, but then this needs to be infinate.</p>
  
  <p>Landscape Generator</p>
  
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  
  public class LandscapeGeneration : MonoBehaviour {
  public int sizeX;
  public int sizeZ;
  
  public int zIndex = 0;
  public GameObject roadBlock;
  
  // Use this for initialization
  void Start () {
      GenerateTerrain();
  
  }
  
  void GenerateTerrain()
  {
      for(int x = 0; x &lt; sizeX; x++)
      {
          for(int z = 0; z &lt; sizeZ; z++)
          {
              zIndex = z;
              Instantiate(roadBlock, new Vector3(x, 0, z), Quaternion.identity);
          }
      }
  }
  
  public void GenerateRow(int row)
  {
      if (row == zIndex)
      {
          zIndex++;
          for (int x = 0; x &lt; sizeX; x++)
          {
              Instantiate(roadBlock, new Vector3(x, 0, zIndex), Quaternion.identity);
          }
      }
  }
  }
  </code></pre>
  
  <p>Block Shredder</p>
  
  <pre><code>using System.Collections;
  using System.Collections.Generic;
  using UnityEngine;
  
  public class BlockShredder : MonoBehaviour {
  
  public GameObject landscape;
  
  public void OnTriggerEnter(Collider other)
  {
      LandscapeGeneration script = landscape.GetComponent&lt;LandscapeGeneration&gt;();
      float x = other.gameObject.transform.position.x + 44;
      Destroy(other.gameObject);
      script.GenerateRow(int.Parse(x.ToString()));
  }
  }
  </code></pre>
  
  <p>My question is why is the world generation stopping and how can I fix it?</p>