09-04-2019, 01:39 PM
Hi,
spline.GetNearestPointTF takes a position in the local space of the spline. This means that
spline.GetNearestPointTF(player.localPosition)
is correct only if both spline and player have the same transform.
You should use instead
spline.GetNearestPointTF(spline.InverseTransformPoint(player.transform.position))
Does this fix your issue?
Have a nice day
spline.GetNearestPointTF takes a position in the local space of the spline. This means that
spline.GetNearestPointTF(player.localPosition)
is correct only if both spline and player have the same transform.
You should use instead
spline.GetNearestPointTF(spline.InverseTransformPoint(player.transform.position))
Does this fix your issue?
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.