Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question about calling the SplinePathMeshBuilder Detach Method from code
I have a quick question with regards to calling the Detach method of SplinePathMeshBuilder from code.

Basically I have a script in Unity that I use to randomly spawn multiple prefabs containing curvy splines and then combine these prefabs so that ultimately I end up with 3 larger splines in the scene. The code then steps through each of these splines in turn and generates a rectanglualr SplinePathMesh for each of the splines. At the end of generating each SplinePathMesh my code then calls the Detach method to generate a detached mesh for each spline path. However when I examine the detached meshes in the scene they don't contain any mesh data i.e. they appear as an empty gameobject. Yet the SplinePathMesh components for each spline clearly contain data and are visible in the scene and if I use the Detach button in the inspector the meshes are correctly deatached.

I suspect that either I am calling the method incorrectly at the end of the SplinePathMesh generation i.e. after I have populated the SplinePathMeshBuilder object with parameters. The code that I am using to call the Deatch method is pathBuilder.Detach() , where pathBuilder is the SplinePathMeshBuilder object that I have created in code to generate the SplinePathMesh.

My other thought was whether or not the SplinePathMesh that I'm wishing to detach needs time to initialise as is sometimes the case when you spawn/instatiate splines?

Any help/advice would be appreciated.

Ok fixed the issue I was having and feel rather stupid [img]images/smilies/blush.gif[/img].

It appears that my hunch that the spline mesh needed time to initialise before being detached was correct. Putting a delay between my generation process and the call to the Detach method gave the correct result.

Possibly Related Threads…
Thread Author Replies Views Last Post
  Question about Timeline support GhuaGhua 3 4 05-21-2024, 01:33 PM
Last Post: _Aka_
  Newbie Question: Uniformly increase spacing between volume spots? SAMYTHEBIGJUICY 1 5 09-01-2023, 03:38 PM
Last Post: _Aka_
  I have a question about curvySpline haifeng.huang 12 32 07-14-2023, 09:34 AM
Last Post: _Aka_
  Question about generator Mos Def 7 1,807 04-10-2023, 10:20 PM
Last Post: _Aka_

Forum Jump: