03-26-2016, 08:10 AM
SplineController.RelativePosition gives you the TF on the spline. You then can use Spline.TFToSegment() to get the local F inside a segment.
A more advanced approach would be to use Metadata. Basically you create a Metadata class and override the method that returns the lerped value. You then can add Metadata classes to your CP's and use Spline API to get interpolated values with ease, "error"-handling (like CP's without Metadata attached etc.) included.
See the Metadata example, and examine the metadata class used for the ship's height as well as the custom controller to apply the height. You can adapt that with ease to return a vector3 or quaternion instead of a float.
A more advanced approach would be to use Metadata. Basically you create a Metadata class and override the method that returns the lerped value. You then can add Metadata classes to your CP's and use Spline API to get interpolated values with ease, "error"-handling (like CP's without Metadata attached etc.) included.
See the Metadata example, and examine the metadata class used for the ship's height as well as the custom controller to apply the height. You can adapt that with ease to return a vector3 or quaternion instead of a float.