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
  Objects Spawning in Runtime Kuxii 5 151 03-25-2020, 03:06 PM
Last Post: _Aka_
Question Check Spline collisions (Pathfinding) Hukha 4 142 03-24-2020, 02:00 PM
Last Post: _Aka_
  Add Template problem in the Generator with Input Spline Shape prefab ATHellboy 1 138 03-13-2020, 11:27 PM
Last Post: _Aka_
  Placing multiple objects on multiple splines digot 4 269 03-02-2020, 08:49 PM
Last Post: digot

Forum Jump: