03-11-2021, 03:59 AM
(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.