Assigning to Vector3 array.

Hi, I'm trying to do some mesh generation. Having some problems with C# arrays. I have a MeshFilter object mMesh and I try:

    Mesh m = mMesh.mesh;
    float segs = 300;
    m.vertices = new Vector3[(int)segs * 2-1];
    for (int i = 0; i < segs; i++)
        Vector3 ans = new Vector3(1,1,1);
        m.vertices.SetValue(new Vector3(ans.x, ans.y, ans.z), i);
*<p>The first Debug prints out 1,1,1 but the second one prints out 0,0,0, I've tried using </p>*
_<p>mVertices *= ans;*_
<em>_mVertices *= new Vector3(ans.x,ans.y,ans.z);*_</em>
<em>_*and even*_</em>
<em><em>_mVertices*.x = ans.x;*_</em></em>
<em><em>_*<p>and none of them seem to work. Any help appreciated.</p>*_</em></em>

Make sure to read the examples in the Mesh class docs. The code there is written like that for a reason; the mesh.vertices array is not a reference to the newVertices array, it's a copy, stored in VRAM. Individual values can't be written to it.