- Home /
Editing vertices
Hi, If I create an object, for example a plane, how could I change, for example, one vertex' position. Lets say it has to move up, from 0 to 1, while the other vertices stay on 0. Is this possible, I searched online but I couldn't find an answer. Thanks in advance.
Have you checked out unity's $$anonymous$$esh documentation page? There are few examples of only changing vertices to generating your own all the time.
Answer by Cherno · Jun 14, 2017 at 03:15 PM
You need the vertex index so you can access in the mesh.vertices array.
int vertexIndex = 12;
Vector3[] vertices_temp = mesh.vertices;
Vector3 vertex_new = vertices_temp[vertexIndex];
vertex_new.y += 1f;
vertices_temp[vertexIndex] = vertex_new;
mesh.vertices = vertices_temp;
Your answer
Follow this Question
Related Questions
UnityEngine.UI.Text characters mesh 0 Answers
Why vertex positions appear (0.0, 0.0, 0.0) ? 1 Answer
Creating a mesh for an overview map 0 Answers
Changing vertex positions of a uGUI Text Mesh 0 Answers
Mesh.vertices are all 0? 1 Answer