Hi, i would like to draw line in editor between vectors but not “all to all”, just between neigbours (polygons of mesh).
That’s what i have ATM (drawing sphere on vectors:
void OnDrawGizmos()
{
Mesh mesh = GetComponent<MeshFilter>().mesh;
Vector3[] vertices = mesh.vertices;
Gizmos.color = color; // color is public variable
for (int i = 0; i < vertices.Length; i++) {
Gizmos.DrawSphere(transform.TransformPoint(vertices*), size);*
}
}
[81731-unity-editor-draw-sphere-01.jpg|81731]*
*
defining neighbours can be a little hard at times, although you could try something like
void OnDrawGizmos()
{
Mesh mesh = GetComponent<MeshFilter>().mesh;
Vector3[] vertices = mesh.vertices;
Gizmos.color = color; // color is public variable
for (int i = 0; i < vertices.Length; i++)
{
Gizmos.DrawSphere(transform.TransformPoint(vertices*), size);*
if (transform.TransformPoint(vertices[i + 1]) != null)
{
Gizmos.DrawLine(transform.TransformPoint(vertices*), transform.TransformPoint(vertices[i + 1]));*
}
}
}
i cant quarantee this will work and it might not give you the solution you worked, you could do a range check aswell, but this script should make a long snake going from vert to vert