Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automated spline generation between objects
#1
Hello,

we are trying to implement a system which generates spline based roads between markers on a UI map.
The goal here is to connect these markers once and have the spline regenerate if any of those objects move avoiding manual recreation of said splines.

What would be the most efficient way to achieve that given all the tools that Curvy offers?

Regards
Alex
Reply
#2
Hi,
There are different ways to achieve that, depending on your setup. I think of two right now:

First method
  • Create a spline. See CurvySpline.Create()
  • for each marker, add a Control Point (CP for short) to the spline. See CurvySpline.Add(...)
  • Check if the markers moved. See Transform.hasChanged
  • Each time a marker changes, updated the position of the corresponding CP. See CurvySplineSegment.SetPosition(...)
Second metod:
  • Create a spline, and make it a parent of all the markers. See CurvySpline.Create()
  • Add a CurvySplineSegmentcomponent to each marker
  • Make the spline update itself from its hierarchy. See CurvySpline.SyncSplineFromHierarchy()
All these methods are documented in code and api.curvyeditor.com
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
  GO can't fit end of the spline GameDeveloperek4123 3 13 03-04-2024, 11:06 AM
Last Post: _Aka_
  Keeping a fixed spline length jh092 3 16 02-21-2024, 06:25 AM
Last Post: Primrose44
  How could I get position in spline from "From" value in BuildRasterizedPath? Chanon 1 8 02-12-2024, 09:54 PM
Last Post: _Aka_

Forum Jump: