Saving Certain Vector3's positions

I am working with editing meshes and I want to sort of stair step my edits. I want them to make very small changes and the vertices that are changed are saved in a new array that will then be changed again until the next step of editing array length is 0 and then it will stop. I have a script that edits but doesn’t go past the very first step:

var firststep : Vector3[];


function Start() {
var mesh : Mesh = GetComponent(MeshFilter).mesh;
var vertices : Vector3[] = mesh.vertices;
var normals : Vector3[] = mesh.normals;
   
for (var i = 0; i < vertices.Length; i++)
{
number1 = Random.Range(0,1);
vertices <em>+= normals _* number1;_</em>

if ( number1 > 0)
{
// here is where I want to add the changed vertices
firststep.Add(vertices*);*
}

}
mesh.vertices = vertices;
print(firststep.Length);
}
so far though this always prints the firststep.Length as zero. It’s not adding any of the changed vertices when I can clearly see them changing. Any ideas?

You can’t add anything to fixed-size arrays like Vector3. Use List instead.

There are two versions of Random.Range(x,y), one for integers, and one for floats. You are passing two integers, so it will return an integer between x and y-1, which in your case is always 0. Make sure you pass two float values to that function, in which case it will return a float value within that range.

I don’t use UnityScript, so I’m not sure about the syntax, but it should be something like

number1 = Random.Range(0.0,1.0);