Hi!
I’m trying to get the vertex positions of a Mesh but I’m having a problem. If the object has a scale of (1,1,1) the vertex positions are right but if I scale the object to (20,20,20) the positions of the vertex are incorrect (they are in the 1,1,1 model positions). I tried with the transform.TransformPoint function but the result is the same.
What am I doing wrong? Thanks in advance
GameObject pista = GameObject.Find (“pruebas”);
Vector3[ ] vertices = pista.GetComponent ().mesh.vertices;
for (int x = 0; x < vertices.Length; x++) {
posicionVertice = vertices [×] + pista.transform.position;
GameObject esfera = GameObject.CreatePrimitive (PrimitiveType.Sphere);
esfera.transform.position = posicionVertice;
}