06-12-2016, 04:49 AM
Hi I've been using curvy for a little while but I'm no expert.
I was modifying some things on the InfiniteTrack example but I noticed the Curvation for X and Y doesn't seem to be working properly it seems to be swapped, X is using the Y axis value and Y is using X. I was wondering if it's a issue with this method or something else
Thanks
I was modifying some things on the InfiniteTrack example but I noticed the Curvation for X and Y doesn't seem to be working properly it seems to be swapped, X is using the Y axis value and Y is using X. I was wondering if it's a issue with this method or something else
Code:
// add more CP's, rotating path by random angles
void addTrackCP()
{
float rndX = Random.value * CurvationX * DTUtility.RandomSign();
float rndY = Random.value * CurvationY * DTUtility.RandomSign();
Vector3 p = TrackSpline.ControlPoints[TrackSpline.ControlPointCount - 1].localPosition;
mDir = Quaternion.Euler(rndX, rndY, 0) * mDir;
TrackSpline.InsertAfter(null).localPosition = p + mDir * CPStepSize;
}
Thanks