Why is the mesh position changing instead of its scale?

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;
}*_

This code:

             vertex.x += 1.0f;
             vertex.z += 1.0f;

is moving the vertex x and z positions. Scaling would be performed by multiplication (by a number between 1 and 0 to shrink, over 1 to expand), but addition would merely move points.


That said, merely switching to a multiplication by some factor may not produce the results you require, because the origin of the mesh would be the center of the expansion/contraction. You may need to consider some particular central point upon which the expansion/contraction is performed.