Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to face forwards when going backwards
#5
The way I would have done it (warning, pseudo code, might not compile due to minor mistakes):

Vector3 closestPointSecondSpline;
secondSpline.GetNearestPointTF(firstSpline.Interpolate (1f, Space.Word), out closestPointSecondSpline), Space.Local);
float closestPointOnSecondSplineTF = secondSpline.GetNearestPointTF(closestPointSecondSpline, Space.Local);
Vector3 tangentOne = firstSpline.GetTangent(1f, Space.World);
Vector3 tangentTwo = secondSpline.GetTangent(closestPointOnSecondSplineTF, Space.World);

Now you have tangents of both closest point on the splines. Compare their direction by using a Dot Product, and that's it.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Messages In This Thread
RE: How to face forwards when going backwards - by _Aka_ - 08-17-2020, 01:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  issues with face over lapping and generator ranges Mos Def 7 2,312 12-13-2020, 07:46 AM
Last Post: _Aka_
  Make GameObject Face towards Spline Path linkinballzpokemon 5 2,394 07-14-2020, 08:27 PM
Last Post: _Aka_
  UI Text move backwards/reverse along Spline Cloov 4 8,349 12-18-2016, 11:56 AM
Last Post: Jake
  [Question] Going backwards (SplineController) Warow 1 3,592 11-25-2016, 08:15 PM
Last Post: Jake

Forum Jump: