Hi there,
Just having a bit of trouble with this, I wanted to instance a prefab at each point of this mesh but I think I’m getting mixed up between points and verts…
I was looking at this mesh as a test
With this script I get 7 points but I would have thought there’d be 5-
//Find all verts in mesh
Mesh mesh = TargetMesh.GetComponent<MeshFilter>().sharedMesh;
Vector3[] vertices = mesh.vertices;
Vector3[] normals = mesh.normals;
MeshCount = vertices.Length;
//Move the helper to the current vert
CurrentPoint = Mathf.Clamp (CurrentPoint, 0, vertices.Length - 1);
PointHelper.position = vertices[CurrentPoint];
So if I instance at each of those verts I’ll get some objects at the same location.
Is there a way to get point position rather than verts maybe? Is that what I’m getting mixed up with?
Thanks!
Pete