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?