09-16-2019, 08:18 AM
(09-11-2019, 10:13 PM)_Aka_ Wrote: Hi,
Here is the relevant part of the code I send to Lukango
Code://Refresh splines to have the tangent information available and up to date
lastSpline.Refresh();
newSpline.Refresh();
var lastTangent = lastSpline.transform.TransformDirection(lastSpline.GetTangent(1));
var firstTangent = newSpline.transform.TransformDirection(newSpline.GetTangent(0));
//rotate the newSpline so that its first tangent aligns with lastSpline's last tangent
newSpline.transform.rotation = newSpline.transform.rotation * Quaternion.FromToRotation(firstTangent, lastTangent);
Is it clear to you?
Have a nice day
Dear Aka,
Thanks for the code, it does makes sense.
All the best
Mario