Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Connection "next' control point
#1
Hi there,

I need some help with this simple Connection use-case.

Below are two splines, Spline 1 is highlighted purple, Spline 2 is the smaller spline not highlighted. If I am on Spline 2 heading towards that connection, how does my custom connection code make me continue on to Spline 1 (in effect, continuing to Spline 1 CP0001)?

That connection has two control points, CP0002 from Spline 1 and CP0000 from Spline 2. When I hit that connection I can only take the "other" branch which is heading back towards CP0003 on Spline 1 which is not what I want? Rejecting any branches that diverge too much leaves me with no option.

Somehow I have to "know" that CP0001 on Spline 1 is my next control point. I really hope this makes sense, it does in my head  Smile

[Image: curvy.png]
Reply
#2
Hi
The controller continues towards Spline 1.CP003 because it is the next one while moving forwards. If you invert the CPs of spline 1, such as CP0000 is the ones at the left and CP0003 is at the right, then the movement will be like you want it to be.
To flip a spline easily, use the "Flip" tool in the toolbar:
https://curvyeditor.com/documentation/toolbar/start#flip
Otherwise, you can try changing the controller direction when reaching the control point with the connection, using the spline controllers' On Control Point Reached event.
Did this help?
Have a nice day.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
Ah thank you for the very quick reply, and yes that is the trick!

Can I please ask one more question then. If I know I need to head towards Spline 1 CP0001 how do I know whether I need to change the controller direction or not (flipping spline won't work for this). I guess I need to know that, from the connection, CP0003 is "forwards" on that spline and CP0001 is backwards on that spline, but how...

thanks again for your valuable time. John.
Reply
#4
Hi
Forward is always traversing the spline from the smallest cp index to the biggest.
Backward does the opposite.
So if you are in CP2, and want to go to CP3, since 3 > 2, then you need to go forward.
I hope this helped.
Have a nice day.
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
  Getting Distance from a World Point zorksox 3 5 04-16-2024, 07:30 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
Thumbs Up Can't delete connection lacota 3 6 03-16-2024, 11:34 AM
Last Post: _Aka_

Forum Jump: