07-09-2019, 12:41 PM
(This post was last modified: 07-09-2019, 12:50 PM by UsernameHed.)
Hello , i have a little issue for a while now, it was'nt bothering me since now.
It's about the Range / lenght settings in the Generator. I change it from an editor tools and I want to set the value depending of 2 Custom SplineController on the spline.
Here I have a part of my raceTrack here:
And the green shape you see is a special Generator, who draw a rectangle in the road, at an given emplacement, with a range of 0.9511405, and a lenght of 0,04026
I have 2 customControllers, here: (they are basicly the same calculation as your CurvyControllers
As you see in the first image, the first customController has the variable percentInSpline at 0.9511405, exactly the value in the generator, and I calculate myself the Range.
it seems to work when I am close to 0, but here is another exemple (same calculation), with a mesh who are in the middle of the spline:
I am sure you are using percentage for the Range & Lenght. So i have tryed to use distance, and then convert it with Spline.DistanceToTF, but the result is then the same.
Mmm ok , I solved it.
Here the convertion CurvySpline.DistanceToTF doesn't worked, so I used my own calculation:
Instead of doing this: StartMesh = GreenController[0].GetPercent()
I do this: StartMesh = GreenController[0].GetDistance() * 1f / lenghtSpine;
and it worked. Cool !
I suggest you to add in the curvyGenerator a way to choose between distance and percent or something like that.
Thanks you x)
It's about the Range / lenght settings in the Generator. I change it from an editor tools and I want to set the value depending of 2 Custom SplineController on the spline.
Here I have a part of my raceTrack here:
And the green shape you see is a special Generator, who draw a rectangle in the road, at an given emplacement, with a range of 0.9511405, and a lenght of 0,04026
I have 2 customControllers, here: (they are basicly the same calculation as your CurvyControllers
As you see in the first image, the first customController has the variable percentInSpline at 0.9511405, exactly the value in the generator, and I calculate myself the Range.
it seems to work when I am close to 0, but here is another exemple (same calculation), with a mesh who are in the middle of the spline:
I am sure you are using percentage for the Range & Lenght. So i have tryed to use distance, and then convert it with Spline.DistanceToTF, but the result is then the same.
Mmm ok , I solved it.
Here the convertion CurvySpline.DistanceToTF doesn't worked, so I used my own calculation:
Instead of doing this: StartMesh = GreenController[0].GetPercent()
I do this: StartMesh = GreenController[0].GetDistance() * 1f / lenghtSpine;
and it worked. Cool !
I suggest you to add in the curvyGenerator a way to choose between distance and percent or something like that.
Thanks you x)