01-13-2024, 12:50 AM
Hi,
I am trying to get a line renderer to draw along a spline between two points of the spline.
At the moment, I create the objects on the spline at their relative positions (eg 0.3 and 0.5 along the spline)
I want the line renderer from the first object to start at that object and finish at the second object.
Currently, I can draw a straight line between the objects (see gif here: https://drive.google.com/file/d/1-aqOJ2Z...YN1TAX_xN/)
I imagine it would be something like:
Any help is appreciated.
Cheers
I am trying to get a line renderer to draw along a spline between two points of the spline.
At the moment, I create the objects on the spline at their relative positions (eg 0.3 and 0.5 along the spline)
I want the line renderer from the first object to start at that object and finish at the second object.
Currently, I can draw a straight line between the objects (see gif here: https://drive.google.com/file/d/1-aqOJ2Z...YN1TAX_xN/)
I imagine it would be something like:
- Get object 1 position on the spline
- Set line renderers positions[0] to object 1
- As the user scrolls across the spline, add another vector3 to the line renderers positions based on the splines relative position
- When the user has scrolled and added the second object, set the line renderers last position to the new objects position (again using the splines relative position)
Any help is appreciated.
Cheers