From 319d55d80bce23588f8d4ab9607b08bf157bc151 Mon Sep 17 00:00:00 2001 From: Josh4359 <77248236+Josh4359@users.noreply.github.com> Date: Mon, 18 Sep 2023 16:02:21 -0700 Subject: [PATCH] Update SplinePlus.cs --- Runtime/SplinePlus.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Runtime/SplinePlus.cs b/Runtime/SplinePlus.cs index bbc6906..908fe3d 100644 --- a/Runtime/SplinePlus.cs +++ b/Runtime/SplinePlus.cs @@ -24,7 +24,7 @@ namespace FrameJosh.SplineImporter public void Evaluate(float anchor, float distance, out Vector3 position, out Quaternion rotation) { - float t = anchor + (distance / splineContainer.Spline.GetLength()); + float t = anchor + (distance / splineContainer.CalculateLength()); if (deformContainer) DeformSpline(t, out position, out rotation); @@ -228,5 +228,10 @@ namespace FrameJosh.SplineImporter } } } + + void Reset() + { + splineContainer = GetComponentInChildren(); + } } }