Cannot move vertices in Mesh Filter

I trying to set vertex[0] in my Mesh to be 0,0,0. but each time I set it to 0,0,0 , Debug.Log always show me vertex[0] is -0.3 ,0.5,2.3. Does anyone know how can I fix it? thanks for help.

I don’t think you can assign individual elements like that. Try this:

Vector3[] vertices = mesh.vertices;
vertices[0] = new Vector3(0, 0, 0);
mesh.vertices = vertices;
2 Likes

Yep working now. thanks for your help.