Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Gradually rendering paths
#1
Hi! Smile I started learning Curvy recently, and I need help figuring something out.

I have a 2D top-down project where I render paths along splines on a map screen. Currently, I use CurvyLineRenderer to generate simple solid lines as paths on the map.

I want to be able to render paths gradually from 0% to 100% of the spline. I thought of subdividing control points very finely, and turning CurvySplineSegments visible and invisible, but that would be choppy and probably inefficient. Is there a property of the spline or the renderer that I could set, that would make the path render up to X%? If so, then I could use it in a tween. Can you advise me on the best way to go about this?
Reply
#2
Hi,
Curvy Line Renderer is basically just getting points from a spline and feeding them to a regular Unity's Line Renderer.
In CurvyLineRenderer.Refresh, you have this line that gets the spline's points:
var vts = Spline.GetApproximation(Space.World);
(sorry for the poorly named local variable)
that variable is an array. You can do whatever you want with it, like reducing its size.
Have a nice day
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply
#3
Hi Aka! Thanks a lot for the quick and informative response!
Reply
#4
You are welcome
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  To dynamic generate the connection between paths Canis 4 2,235 08-07-2020, 07:33 PM
Last Post: _Aka_
  rendering a road with junction dazz777 3 3,285 07-12-2019, 11:19 AM
Last Post: _Aka_
  One generator for multiple paths justinms66 10 12,175 05-30-2019, 03:48 AM
Last Post: Horibe
  Referencing Paths in Editor johnnemann 2 4,470 06-15-2016, 01:43 PM
Last Post: Jake

Forum Jump: