Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Finding relative position across connected splines
Is there a simple way to determine the relative position of two spline controllers on separate, connected splines?   I'd like to determine what position a train car is within a train (first, second, third, etc.) when the train itself may span multiple splines.

I'm guessing that I'll need to create a list of the track splines (or a lookup table) and assign values to each spline to define 'west' and 'east' relative positions for each, but I'm wondering if there is an easier solution.
Deko Games
The distance between two cars can vary depending on the track, whether it is a line or a circle for example. But still, those changes should not be very big (expect if your track has very tight turns). So why not just compute the distance between the cars, divide it by the length of a car, and round to the closest number. That should indicate the number of cars in between.
Did this help?
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.

Possibly Related Threads…
Thread Author Replies Views Last Post
  Using Unity's SplineContainer in Curvy Splines dlees9191 2 5 6 hours ago
Last Post: iDerp69
  Avoiding runtime GC allocations on control point position change Ell223 8 15 Today, 10:43 AM
Last Post: _Aka_
  Distance travelled across multiple splines jh092 1 4 Yesterday, 09:44 AM
Last Post: _Aka_
  How could I get position in spline from "From" value in BuildRasterizedPath? Chanon 1 6 02-12-2024, 09:54 PM
Last Post: _Aka_

Forum Jump: