get lineRenderer positions

Hi,

How can i find out the value (Vector3) of a certain lineRenderer position at a particular index? I see the array in the inspector but I can’t seem to be able to access it :confused:

1 Answer

1

I store my vector3’s in a

private List<Vector3> linePositions;

And edit those positions prior to setting the vectors in the line renderer in my update loop, etc. I believe that this is the preferred implementation pattern based on the availability of points in the line renderer component.

Ok, did that. I thought i wouldn't need another array with the same contents :/

–

In most of the use-cases I've come up with for line rendering the positions for the line are almost always of a transient nature anyway. I can't imagine why they didn't expose the array unless it's some kind of unmanaged set or something. Vectrosity supports a wider variety of options in this regard but even then there is a layer of abstraction between the verts on screen and the vector3s you can work with.

–