Hi,
I would like to use @Bunny83’s script “custom line renderer”, but because I remove the last vertices after one second, and “mesh.vertices” is a built-in array with a specific size, it says :
Mesh.vertices is too small. The supplied vertex array has less vertices than are referenced by the triangles array.
UnityEngine.Mesh:set_vertices(Vector3[])
Is there a way to avoid this error? I have tried to replace the built-in array with a List, but Unity does not allow it. Would you have any idea?
Here is the link : Can I render nice thick lines with LineRenderer (without any artifacts)? - Questions & Answers - Unity Discussions
Thanks
EDIT :
My function in another script is like that :
void Update () {
if(myPoints != null){
lineRenderer.SetVertexCount(myPoints.Count);
for(int i = 0;i<myPoints.Count;i++){
lineRenderer.SetPosition(i,myPoints*);*
-
}* -
}* -
else* -
lineRenderer.SetVertexCount(0);*