title: Creating plane mesh
body: <p>I am trying to create a plane mesh in unity. I am able to obtain a mesh with two triangles, but I am not able to obtain a mesh with more than two in a row. I am trying to obtain a lengthy mesh with many triangles in a row connected together. I hope u would understand if you have a look at my code. </p>
  
  <p>My code has no error but I am not able to see the mesh. I need help.</p>
  
  <pre><code>private float space = 40 / 200;
      MeshFilter mf;
      Mesh mesh;
      private Vector3[] vertices = new Vector3[400];
  
      void Start () 
      {
          mf = GetComponent&lt;MeshFilter&gt;();
          mesh = mf.mesh;
          mesh.Clear();
  
          #region Vertices
          for (int i = 0; i &lt; 200; i++)
          {
              vertices[i] = new Vector3(-20 + i * space, -6, 0);          //Top vertices
              vertices[i+200] = new Vector3(-20 + i * space, -10, 0);     //Bottom vertices
          }
          #endregion
  
          #region Normals
          Vector3[] Normals = new Vector3[400];
  
          for(int i = 0; i &lt; 400; i++)
              Normals[i] = Vector3.back;
          #endregion
  
          #region uvs
          Vector2[] uvs = new Vector2[400];
  
          Vector2 _00 = new Vector2(0, 0);
          Vector2 _10 = new Vector2(1, 0);
          Vector2 _01 = new Vector2(0, 1);
          Vector2 _11 = new Vector2(1, 1);
  
          for(int i=0; i&lt;200; i++)
          {
              uvs[i] = new Vector2(i/199, 1);
              uvs[i+200] = new Vector2(0, i/199);
          }
  
          #endregion
  
          #region Triangles
          int[] Triangle = new int[(200-1) * 2 * 3];
          int t = 0;
  
          for(int i=0; i&lt;200 - 1; i++)
          {
              Triangle[t++] = i;
              Triangle[t++] = i + 200 + 1;
              Triangle[t++] = i + 200;
  
              Triangle[t++] = i;
              Triangle[t++] = i + 1;
              Triangle[t++] = i + 200 + 1;
          }
          #endregion
  
          mesh.vertices = vertices;
          mesh.normals = Normals;
          mesh.uv = uvs;
          mesh.triangles = Triangle;
  
          mesh.RecalculateBounds();
          mesh.Optimize();
      }
  </code></pre>