x


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 :/

more ▼

asked Feb 15 '12 at 07:26 PM

Somian gravatar image

Somian
206 35 46 52

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Feb 15 '12 at 09:35 PM

tingham gravatar image

tingham
645 2 6 13

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

Feb 16 '12 at 02:46 AM Somian

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.

Feb 16 '12 at 02:53 PM tingham
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x108

asked: Feb 15 '12 at 07:26 PM

Seen: 1198 times

Last Updated: Feb 16 '12 at 03:00 PM