06-14-2016, 01:32 PM
I am using the Spline Controller to move an object along a single spline.
Sometimes I need to "reset" the object to the start of the spline. How do I do that?
I tried calling
mysplineController.Stop();
mysplineController.Play();
but that didn't seem to work so then I did
mysplineController.ResetOnStop = true;
mysplineController.Stop();
mysplineController.Play();
But that causes an exception below.
I also tried mysplineController.Warp(0);
What is the best way to reset the object to the start of the spline?
Thanks
Jim
IndexOutOfRangeException: Array index is out of range.
FluffyUnderware.Curvy.CurvySplineSegment.DistanceToLocalF (Single localDistance) (at Assets/Packages/Curvy/Base/CurvySplineSegment.cs:2040)
FluffyUnderware.Curvy.CurvySpline.DistanceToTF (Single distance, CurvyClamping clamping) (at Assets/Packages/Curvy/Base/CurvySpline.cs:1100)
FluffyUnderware.Curvy.CurvySplineBase.DistanceToTF (Single distance) (at Assets/Packages/Curvy/Base/CurvySplineBase.cs:411)
FluffyUnderware.Curvy.CurvySplineBase.MoveByLengthFast (System.Single& tf, System.Int32& direction, Single distance, CurvyClamping clamping) (at Assets/Packages/Curvy/Base/CurvySplineBase.cs:724)
FluffyUnderware.Curvy.CurvySpline.MoveByLengthFast (System.Single& tf, System.Int32& direction, Single distance, CurvyClamping clamping) (at Assets/Packages/Curvy/Base/CurvySpline.cs:1184)
FluffyUnderware.Curvy.Controllers.SplineController.Advance (System.Single& tf, System.Int32& direction, MoveModeEnum mode, Single absSpeed, CurvyClamping clamping) (at Assets/Packages/Curvy/Controllers/SplineController.cs:443)
FluffyUnderware.Curvy.CurvyController.Refresh () (at Assets/Packages/Curvy/Base/CurvyController.cs:842)
FluffyUnderware.Curvy.Controllers.SplineController.Refresh () (at Assets/Packages/Curvy/Controllers/SplineController.cs:258)
FluffyUnderware.Curvy.CurvyController.Update () (at Assets/Packages/Curvy/Base/CurvyController.cs:609)
Sometimes I need to "reset" the object to the start of the spline. How do I do that?
I tried calling
mysplineController.Stop();
mysplineController.Play();
but that didn't seem to work so then I did
mysplineController.ResetOnStop = true;
mysplineController.Stop();
mysplineController.Play();
But that causes an exception below.
I also tried mysplineController.Warp(0);
What is the best way to reset the object to the start of the spline?
Thanks
Jim
IndexOutOfRangeException: Array index is out of range.
FluffyUnderware.Curvy.CurvySplineSegment.DistanceToLocalF (Single localDistance) (at Assets/Packages/Curvy/Base/CurvySplineSegment.cs:2040)
FluffyUnderware.Curvy.CurvySpline.DistanceToTF (Single distance, CurvyClamping clamping) (at Assets/Packages/Curvy/Base/CurvySpline.cs:1100)
FluffyUnderware.Curvy.CurvySplineBase.DistanceToTF (Single distance) (at Assets/Packages/Curvy/Base/CurvySplineBase.cs:411)
FluffyUnderware.Curvy.CurvySplineBase.MoveByLengthFast (System.Single& tf, System.Int32& direction, Single distance, CurvyClamping clamping) (at Assets/Packages/Curvy/Base/CurvySplineBase.cs:724)
FluffyUnderware.Curvy.CurvySpline.MoveByLengthFast (System.Single& tf, System.Int32& direction, Single distance, CurvyClamping clamping) (at Assets/Packages/Curvy/Base/CurvySpline.cs:1184)
FluffyUnderware.Curvy.Controllers.SplineController.Advance (System.Single& tf, System.Int32& direction, MoveModeEnum mode, Single absSpeed, CurvyClamping clamping) (at Assets/Packages/Curvy/Controllers/SplineController.cs:443)
FluffyUnderware.Curvy.CurvyController.Refresh () (at Assets/Packages/Curvy/Base/CurvyController.cs:842)
FluffyUnderware.Curvy.Controllers.SplineController.Refresh () (at Assets/Packages/Curvy/Controllers/SplineController.cs:258)
FluffyUnderware.Curvy.CurvyController.Update () (at Assets/Packages/Curvy/Base/CurvyController.cs:609)