Hi all, I've got a pretty simple setup: a single spline linked to a script, where at Start() I need to analyze the curvature of the spline, so I do:
Even though the Spline is correctly linked and instantiated, I get:
At line 519 of CurvySpline.cs, where DistanceToSegment gets mSegment[0]. An mSegment.Count before that line returns 0. Not sure what to try next.
There definitely seems to be a delay before you can access the spline for some reason. If I stick
into an Update(), the first one gives a NullReferenceException but all subsequent ones work. How should we work around this?
Ah. Just discovered CurvySpline.IsInitialized. My bad.
Code:
float tf = 0f;
float distance = 0.0f;
while(tf < 1){
tf = spline.DistanceToTF(distance);
...
}
Even though the Spline is correctly linked and instantiated, I get:
Code:
ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
There definitely seems to be a delay before you can access the spline for some reason. If I stick
Code:
Debug.Log(spline.TFToSegment(0f));
Ah. Just discovered CurvySpline.IsInitialized. My bad.