Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SplineController Ignores Follow-Up and Chooses Wrong Spline
#1
Hi, I have a connection between two splines and I’ve set a Follow-Up on that connection point to explicitly define which spline the controller should follow next. However, the
SplineController sometimes follows a different spline that wasn't specified.
The Connection Handling setting is set to:
"Follow-Up, otherwise random"
Why is it not always following the assigned Follow-Up spline?
What could cause the controller to ignore the Follow-Up and go to another connected spline?

(video attached)


Attached Files Thumbnail(s)
   

.mp4   curvy.mp4 (Size: 1.62 MB / Downloads: 3)
Reply
#2
Hi Josenildo,
From looking at the video, I couldn't see what was wrong. Can you please send me the reproduction case so I can dig deeper? In case you didn't know: if you right click on the scene file in the Project window, you can then export the scene as a package, which will give you the option to also include all the used assets. This way you make sure your reproduction case has all the necessary assets, and only the necessary assets.
Thank you.
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#3
I've provided the package as you suggested. I'm using Unity 6.0.32f1 with URP and Curvy version 8.7.1.
spline_connector_test.unitypackage

I tried creating a new project, importing the package and the latest version of Curvy to test things out. However, it seems like the scene became messy and things didn’t import correctly. I considered updating Curvy in my main project to see if that might resolve the issue, but I'm hesitant to do so, as I'm concerned it could break the current setup.
Let me know how best to proceed, or if you were able to reproduce the issue on your end.

Thanks!
Reply
#4
Hi again,

I managed to get the necessary information from your package, thank you

The issue is that your controller basically behaves as if it's choosing a random spline when it reaches the connection. This is because the option you chose is "Follow-up otherwise random," but road_spline_01.CP0014 does not have a Follow-Up. In fact, it is road_spline_conection_3.CP0001 that has road_spline_01.CP0014 as a Follow-Up, and not the other way.

Feel free to read this documentation and watch the video tutorial at the same page to better understand Follow-Ups. For the sake of this conversation, just keep in mind that only a control point that is the start or end of an open spline can have a Follow-Up .

When the controller switches to the secondary spline, it basically switches to its last control point and automatically loops to its first control point, since your controller options allow that. 

This explains the behavior in your video.

Attached is an image of the configuration that allows the spline and the controller to switch to the secondary spline when reaching a connection.

About the update, I make a lot of effort in keeping all minor versions compatible, and introducing breaking changes only in change of major versions. But as an additional precaution, always backup your project before an update, and always read the release notes before installing an update.

I hope this helped.
Have a nice day.


Attached Files Thumbnail(s)
   
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#5
Sorry, maybe I didn't explain it well — or perhaps I'm still not fully understanding how it works.
At "connection 5", I need both objects coming from road_spline_01.CP0014 and from road_spline_connection_3.CP0001 to continue to road_spline_01.CP0015. That's why both control points are set with a "Follow-Up" to road_spline_01.CP0014.
The SplineController is configured as "Follow-Up Otherwise Random", since in other connections there are valid branching options. However, sometimes objects coming from road_spline_01.CP0014 go to road_spline_connection_3.CP0000, which I don't want. I’d like to force the flow to always continue to
road_spline_01.CP0015 after road_spline_01.CP0014, with no possibility of switching splines at that point.

I've attached some screenshots — could you please take a look and let me know if I'm configuring something incorrectly?

Thanks a lot for your help and patience!


Attached Files Thumbnail(s)
               
Reply
#6
Hi,

The “Follow Up Otherwise Random” predefined value you have been using until now, or any other predefined value, is static, meaning that the car applies the same logic to every connection it encounters. This approach does not scale well when needing different complex behaviors depending on each connection ,which is what you already have or may have in the future.

The solution I am thinking of will make each connection define its main spline, meaning the spline on which the car should remain if it is already on it, or the spline to which the car should switch if it is currently on a different one. This information will then be used by the car to determine whether it should change splines or stay on the same one.

In technical terms, this means
  • Find a way to define which spline is the main one. This can be dynamically defined (for example the closed spline is always the main one, assuming their ins only one closed spline per connection), or statically using a custom control point meta data to store the main spline information. See E12_MDJunctionControl.cs for an example, used in example scene 12.
  • Set the connection to Custom, and make it use a custom connection logic implemented in a subclass ConnectedControlPointsSelector. See the this documentation to learn more: https://curvyeditor.com/documentation/co...s_handling

I hope this was clear.

Have a nice day.
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#7
Thank you for the detailed explanation — it's much clearer now!

Your suggestion of defining a main spline per connection makes a lot of sense, and I’ll try this.

Thanks again for your support!
Reply
#8
You are welcome.
If and when you feel like it, please leave a review for the asset, that helps a lot.
Have a nice day.
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 7 4,429 07-13-2025, 07:11 PM
Last Post: _Aka_
  Is there a way to get the position of each ControlPoint in spline by API? Chanon 1 1,651 06-07-2025, 09:44 AM
Last Post: _Aka_
  Filling a closed spline dynamically rickgplus 1 1,684 04-16-2025, 08:56 AM
Last Post: _Aka_
  Disable a spline's gizmo when not selected or disabled. mikechr2000 1 1,312 02-03-2025, 09:34 AM
Last Post: _Aka_

Forum Jump: