Thanks for the quick response.
I've implemented a custom solution, but I'm getting stuck on calculating the tangent.
In the attachment you can see the yellow line representing the perpendicular. But I'm expecting a vector more like the purple one.
Am I doing something wrong to calculate the perpendicular? Or am I misinterpreting what the tangent actually is?
Thank you so much in advance!
I've implemented a custom solution, but I'm getting stuck on calculating the tangent.
Code:
private Vector3 CalculateOffset(CurvySplineSegment originalSplineSegment)
{
if (m_CurvySpline == null || originalSplineSegment == null)
return Vector3.zero;
Vector3 tangent = m_CurvySpline.GetTangent(originalSplineSegment.TF);
Vector3 perpendicularTangent = Vector3.Cross(tangent, originalSplineSegment.transform.up);
Vector3 offset = perpendicularTangent * m_Offset;
Debug.DrawLine(originalSplineSegment.transform.position, originalSplineSegment.transform.position + (tangent * m_Offset), Color.yellow, 10.0f);
Debug.DrawLine(originalSplineSegment.transform.position, originalSplineSegment.transform.position + (perpendicularTangent * m_Offset), Color.red, 10.0f);
return offset;
}In the attachment you can see the yellow line representing the perpendicular. But I'm expecting a vector more like the purple one.
Am I doing something wrong to calculate the perpendicular? Or am I misinterpreting what the tangent actually is?
Thank you so much in advance!

