Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Difficulty with connections
#2
Hi,
  • Here is the documentation for the connections: https://curvyeditor.com/documentation/splines/connections
  • Your TrainConnectionDecider selects either the first or last Control Point of the connection's CPs. I would not advise you to code it like that, because it makes assumptions about the order of the CPs in that list. It is better to make the code select either the current CP, or the other CP, by doing the right equality checks. This way of doing will stay correct whatever the order of the CPs in the list. This probably explains why your train changes track while you want it to stay on the same track.
  • The train jumps to the other end of the spline because I suppose that you connected your main track's CP with the last CP of the other track. So the train changes track, and finds itself at the last CP of the new track. It then loops to the start of the track. To fix this, either connect the main track's CP with the first CP of the secondary track, or make your connection handling code change the direction of the train when it changes the track.
You don't have to code your own diverging spline rejecting code, and direction changing code, these are already coded. You can find them in SplineController methods GetAngleBetweenConnectedSplinesGetPostConnectionDirection. An example of their usage is in the HandleRandomConnectionBehavior method. Some of the cited methods are private.

If after applying the above you still have issues, please write me back with preferably the scene you are working with.

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


Messages In This Thread
Difficulty with connections - by justinms66 - 08-07-2018, 11:17 PM
RE: Difficulty with connections - by _Aka_ - 08-08-2018, 11:30 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Connections Problem Juton 3 16 03-06-2024, 10:41 AM
Last Post: _Aka_
  Are connections pooled? Lupos 1 3 05-09-2023, 09:18 AM
Last Post: _Aka_
  How to merge intersecting meshes at spline connections? Reign_of_Light 2 6 03-20-2023, 08:36 AM
Last Post: Reign_of_Light
  Null Ref when using Connections RKTRAINS 1 2 10-10-2022, 08:49 AM
Last Post: _Aka_

Forum Jump: