Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CurvySpline cannot find its own segments
#1
Question 
Here's a weird one. I've got a collection of objects, all prefabs, which each contain a CurvySpline object. Each spline already has its Segments placed. My code instantiates an object in the scene, then calls a function to add the CurvySpline from the new object into the main SplineGroup. The spline group addition works perfectly, however I want to make sure the start / end points of the splines match up, so I'm trying to get the segments. Problem is, the spline doesn't seem to know they exist, even though the path itself runs correct when objects are placed on it.

Here's my code with notes on what each debug output does:

Code:
    private void connectBlockSplines(CurvySpline inSpline)
    {
        movementPathSplineGroup.Add(inSpline);

        Debug.Log(inSpline.Segments.Count + " / " + inSpline.ControlPoints.Count); // Always shows 0 / 0
        Debug.Log(inSpline.FirstVisibleControlPoint); // Always shows null
        Debug.Log(inSpline.LastVisibleControlPoint); // Always shows null
    }

Am I doing this wrong? Any tips on how to properly get the spline segments?

Thanks!
Reply


Messages In This Thread
CurvySpline cannot find its own segments - by DCalabrese - 05-11-2014, 02:32 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  I have a question about curvySpline haifeng.huang 12 32 07-14-2023, 09:34 AM
Last Post: _Aka_
  "Deadloop in CurvySPline.Refresh" spam Valkymaera 3 11 05-30-2023, 10:56 AM
Last Post: _Aka_
Video Spline Gizmos & Segments Invisible while Drawing ricke 19 51 04-14-2023, 01:41 AM
Last Post: ricke
  Gap between spline mesh segments Beaver_Boy 13 73 10-24-2022, 09:37 AM
Last Post: dromo

Forum Jump: