05-03-2019, 02:54 PM
(This post was last modified: 05-03-2019, 03:04 PM by UsernameHed.)
Thanks you for your reply ! I have 2 more question
5 )I just saw you didn't undestand my first question, I will try to reiterate:
I have a float _percent, between 0 and 1.
How can I get a Vector3 position ? (without SplineController, I have just an CurvySpline):
Same with rotation, I would like to get the rotation who follow the spline, like that:
6 ) It's less a suggestion this one. With GetNearestPointTF, we can have the float, based on the local Position:
But if pos is not a local position, we have to convert it like that: (not tested):
It would be good if we could pass a bool local = true at the function GetNearestPointTF .
Thanks you for your amazingn support
5 )I just saw you didn't undestand my first question, I will try to reiterate:
I have a float _percent, between 0 and 1.
How can I get a Vector3 position ? (without SplineController, I have just an CurvySpline):
Code:
Vector3 posByPercent = _splineCurvyPlayer.GetWorldPosByPercent(_percent);
Same with rotation, I would like to get the rotation who follow the spline, like that:
Code:
Quaternion rotationForward = _splineCurvyPlayer.GetWorldRotationByPercent(_percent);
6 ) It's less a suggestion this one. With GetNearestPointTF, we can have the float, based on the local Position:
Code:
float nearest = _splineCurvyPlayer.GetNearestPointTF(pos, out closestPosition);
But if pos is not a local position, we have to convert it like that: (not tested):
Code:
Vector3 posRelative = _splineCurvyPlayer.transform.InverseTransformPoint(pos);
float nearest = _splineCurvyPlayer.GetNearestPointTF(posRelative , out closestPosition);
It would be good if we could pass a bool local = true at the function GetNearestPointTF .
Thanks you for your amazingn support