Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SplineController Reset to initial Position
#1
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)
Reply


Messages In This Thread
SplineController Reset to initial Position - by aspartamed - 06-14-2016, 01:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_
  Avoiding runtime GC allocations on control point position change Ell223 8 18 02-24-2024, 10:43 AM
Last Post: _Aka_
  How could I get position in spline from "From" value in BuildRasterizedPath? Chanon 1 8 02-12-2024, 09:54 PM
Last Post: _Aka_
  Finding relative position across connected splines DekoGames 1 8 02-05-2024, 10:11 PM
Last Post: _Aka_

Forum Jump: