Am trying to change the scale of a specific part of the mesh based on the vertex color. Now it works because only the blue vertices are affected, but for some reason they change their position instead of their scale:
Color [] color;
Vector3[] vertices;
Vector3 vertex;
void Start ()
{
vertices = GetComponent <MeshFilter> ().mesh.vertices;
color = GetComponent<MeshFilter> ().sharedMesh.colors;
}
void Update ()
{
for (int i = 0; i < vertices.Length; i++)
{
if (Input.GetKey (KeyCode.T))
{
if (color *== Color.blue)*
-
{*
_ vertex = vertices ;_
* vertex.x += 1.0f;*
* vertex.z += 1.0f;*
_ vertices = vertex;
* }
}
}
this.GetComponent ().mesh.vertices = vertices;
}*_