Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stack Overflow
#2
And sometimes (random actually), I get this error,

NullReferenceException: Object reference not set to an instance of an object
CurvySpline.MoveConnection (.CurvySpline& spline, System.Single& tf, System.Int32& direction, Single fDistance, CurvyClamping clamping, Int32 minMatchesNeeded, System.String[] tags) (at Assets/Curvy/Base/CurvySpline.cs:573)

cause con = CurvyConnection.GetBestMatchingConnection(cons, tags); returns null : 

 public Vector3 MoveConnection(ref CurvySpline spline, ref float tf, ref int direction, float fDistance, CurvyClamping clamping, int minMatchesNeeded, params string[] tags)
    {
        List<CurvyConnection> cons = GetConnectionsWithin(tf, direction, fDistance, minMatchesNeeded,true, tags);
        if (cons.Count > 0) {
            CurvyConnection con;
            if (cons.Count == 1)
                con = cons[0];
            else
                con = CurvyConnection.GetBestMatchingConnection(cons, tags);
            CurvySplineSegment cp=con.GetFromSpline(this);
            float cptf = SegmentToTF(cp);
            fDistance-= cptf-tf;
            CurvySplineSegment counterp=con.GetCounterpart(cp);
            tf = counterp.LocalFToTF(0);
            spline = counterp.Spline;
            return spline.MoveConnection(ref spline, ref tf, ref direction, fDistance, clamping, minMatchesNeeded, tags);
        }
        else
            return spline.Move(ref tf, ref direction, fDistance, clamping);
     }
Reply


Messages In This Thread
Stack Overflow - by lelag - 12-18-2013, 10:26 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Exclamation Stack overflow when editing prefab containing splines rhys_vdw 5 24 04-10-2023, 10:17 PM
Last Post: _Aka_

Forum Jump: