12-24-2019, 10:00 AM
Hi, sorry aka because my carelessness.
I checked it carefully again. It seems like it is the case
"This is probably because it is a Bézier spline, and the Bézier handle at the first CP is very long while the one at the second CP is very short."
This problem occurs because the position of 3 CP is so different. Although there are many segments like this on the whole game but usually will only be in 1 -2 segments.
Is there any way to fix this problem? . My game is music game and requires the position of the points to be accurate, so stretching the distance between points is can't.
I tried checking how CP works. But I don't understand anything.
I use this code to creat cp point ( edit from InfinitieTrack)
Vector3 p = TrackSpline.ControlPointsList[TrackSpline.ControlPointCount - 1].transform.localPosition;
Vector3 position = TrackSpline.transform.localToWorldMatrix.MultiplyPoint3x4(p + mDir * CPStepSize);
float rndX = valueCurX;
totalCurvationX += rndX;
float rndY = CurvationY * RoadDefine;
mDir = Quaternion.Euler(rndX, rndY, 0) * mDir;
//Skip Fist node spline
if (TrackSpline.ControlPointCount > 1) CreatRingAndAddNode(position);
CurvySplineSegment newControlPoint = TrackSpline.InsertAfter(null, position, true);
rndX allway to be 0. rndY random 0-10. CPStepSize calculate follow time between node of song.
This is screenshot of the gizmo's error.
https://imgur.com/xOc5yeO
https://imgur.com/elkVvO8
https://imgur.com/e3asiSc
https://imgur.com/1gFxUzt
Thank you first. Aka
I checked it carefully again. It seems like it is the case
"This is probably because it is a Bézier spline, and the Bézier handle at the first CP is very long while the one at the second CP is very short."
This problem occurs because the position of 3 CP is so different. Although there are many segments like this on the whole game but usually will only be in 1 -2 segments.
Is there any way to fix this problem? . My game is music game and requires the position of the points to be accurate, so stretching the distance between points is can't.
I tried checking how CP works. But I don't understand anything.
I use this code to creat cp point ( edit from InfinitieTrack)
Vector3 p = TrackSpline.ControlPointsList[TrackSpline.ControlPointCount - 1].transform.localPosition;
Vector3 position = TrackSpline.transform.localToWorldMatrix.MultiplyPoint3x4(p + mDir * CPStepSize);
float rndX = valueCurX;
totalCurvationX += rndX;
float rndY = CurvationY * RoadDefine;
mDir = Quaternion.Euler(rndX, rndY, 0) * mDir;
//Skip Fist node spline
if (TrackSpline.ControlPointCount > 1) CreatRingAndAddNode(position);
CurvySplineSegment newControlPoint = TrackSpline.InsertAfter(null, position, true);
rndX allway to be 0. rndY random 0-10. CPStepSize calculate follow time between node of song.
This is screenshot of the gizmo's error.
https://imgur.com/xOc5yeO
https://imgur.com/elkVvO8
https://imgur.com/e3asiSc
https://imgur.com/1gFxUzt
Thank you first. Aka
Death is like the wind. Always by my side.