Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Connect two spline at runtime
#1
Hi there,

I want to create a procedural world where splines have to connect at runtime.

I think I am on the right track but I can't get the connection finalized meaning the same process when clicking in the Inspector: Connection - Control Point Options - Synchronization Presets -  "Position and Rotation" after which the connection will be blended together.


Code:
var lastVisibleControlPoint = lastSplineController.Spline.LastVisibleControlPoint;
            var firstVisibleControlPoint = firstSplineController.Spline.FirstVisibleControlPoint;
           
            var connection = CurvyConnection.Create(lastVisibleControlPoint, firstVisibleControlPoint);
            connection.SetSynchronisationPositionAndRotation(lastVisibleControlPoint.transform.position, lastVisibleControlPoint.transform.rotation);


What am I missing here?

Thanks a lot for helping out!
Reply
#2
Hi

What you are missing is to set the following properties of your controls points to true:
ConnectionSyncPosition
ConnectionSyncRotation

When you select a preset in the connection inspector, you can see that what it does is to modify the "Sync Position" and "Sync Rotation" values of the connected control points. There are the the properties I listed above.

I hope this helped. Feel free to ask if you need anything else.
If and when you feel like it, please leave a review for the asset, that helps a lot.
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
(05-18-2022, 12:04 PM)_Aka_ Wrote: Hi

What you are missing is to set the following properties of your controls points to true:
ConnectionSyncPosition
ConnectionSyncRotation

When you select a preset in the connection inspector, you can see that what it does is to modify the "Sync Position" and "Sync Rotation" values of the connected control points. There are the the properties I listed above.

I hope this helped. Feel free to ask if you need anything else.
If and when you feel like it, please leave a review for the asset, that helps a lot.
Have a nice day

Hi,
thanks for helping out, works perfectly fine!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Extrude mesh along spline. New and confused user GhostStalker 3 7 01-02-2025, 09:58 AM
Last Post: _Aka_
  Newly created spline is invisible quickytools 7 19 12-21-2024, 10:14 AM
Last Post: _Aka_
  Method of scattering objects along spline joebain 1 3 11-26-2024, 03:20 PM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 5 13 10-29-2024, 10:19 AM
Last Post: _Aka_

Forum Jump: