Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IndexOutOfRangeException in CurvySplineSegment.LocalFToDistance function
#5
(03-10-2021, 11:55 AM)_Aka_ Wrote: You are welcome

Please insert the following code just above the line 1397 that produces the exception, that will help understand what is happening once the exception happens again.
Code:
            if(idx >= ApproximationDistances.Length)
                Debug.LogError($"idx: {idx} ; length {ApproximationDistances.Length} ; length 2 {Approximation.Length}");
            else if (idx + 1 >= ApproximationDistances.Length)
                Debug.LogError($"idx  + 1: {idx + 1}  length {ApproximationDistances.Length} ; length 2 {Approximation.Length}");

hi aka,

thanks, i managed to get the error again, but this is before you replied me, so i haven't added this snippet yet. But here is the full call stack:

Code:
IndexOutOfRangeException: Index was outside the bounds of the array.
FluffyUnderware.Curvy.CurvySplineSegment.LocalFToDistance (System.Single localF) (at Assets/Michael/Plugins/Curvy/Base/CurvySplineSegment.cs:1397)
FluffyUnderware.Curvy.Controllers.SplineController.MovementCompatibleGetPosition (FluffyUnderware.Curvy.Controllers.SplineController controller, FluffyUnderware.Curvy.CurvyPositionMode positionMode, FluffyUnderware.Curvy.CurvySplineSegment& controlPoint, System.Boolean& isOnControlPoint, System.Single clampedPosition) (at Assets/Michael/Plugins/Curvy/Controllers/SplineController.cs:615)
FluffyUnderware.Curvy.Controllers.SplineController.EventAwareMove (System.Single distance) (at Assets/Michael/Plugins/Curvy/Controllers/SplineController.cs:722)
FluffyUnderware.Curvy.Controllers.SplineController.Advance (System.Single speed, System.Single deltaTime) (at Assets/Michael/Plugins/Curvy/Controllers/SplineController.cs:487)
FluffyUnderware.Curvy.Controllers.CurvyController.InitializedApplyDeltaTime (System.Single deltaTime) (at Assets/Michael/Plugins/Curvy/Controllers/CurvyController.cs:675)
FluffyUnderware.Curvy.Controllers.SplineController.InitializedApplyDeltaTime (System.Single deltaTime) (at Assets/Michael/Plugins/Curvy/Controllers/SplineController.cs:531)
FluffyUnderware.Curvy.Controllers.CurvyController.ApplyDeltaTime (System.Single deltaTime) (at Assets/Michael/Plugins/Curvy/Controllers/CurvyController.cs:1014)
FluffyUnderware.Curvy.Controllers.CurvyController.Update () (at Assets/Michael/Plugins/Curvy/Controllers/CurvyController.cs:605)

ive found that the code is triggered when the splinemode is worldunits, which is weird since all of my splines are in "relative" mode. I will insert this snippet and try again.
Reply


Messages In This Thread
RE: IndexOutOfRangeException in CurvySplineSegment.LocalFToDistance function - by mchangxe - 03-11-2021, 03:59 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Disabling a CurvySplineSegment results in NullRefException Lupos 1 6 10-02-2023, 09:55 AM
Last Post: _Aka_
  Custom CurvySplineSegment prefabs Lupos 1 10 10-02-2023, 09:36 AM
Last Post: _Aka_
  Does Curvy has gameobjects pooling system function? Chanon 7 13 09-07-2023, 12:43 PM
Last Post: _Aka_
  IndexOutOfRangeException in CurvySplineSegment.LocalFToDistance billowe 2 753 09-06-2022, 06:09 AM
Last Post: sambutle

Forum Jump: