07-27-2017, 07:48 PM
Hi Jake, I'm not sure why your previous response has been deleted. I'm trying to use the approach you described but I'm receiving an error:
"The object you want to initiate is null" stack trace refering to the CreateMesh.cs: 457
I'm attempting to use the generator you setup in the examples 15_CGExtrusionAdvanced with my own spline data, using the following code. Any thoughts on where this is going wrong?
"The object you want to initiate is null" stack trace refering to the CreateMesh.cs: 457
I'm attempting to use the generator you setup in the examples 15_CGExtrusionAdvanced with my own spline data, using the following code. Any thoughts on where this is going wrong?
Code:
Track[] tracks = trackList.Track;
CurvyGenerator cgen = FindObjectOfType(typeof(CurvyGenerator)) as CurvyGenerator;
cgen.AutoRefresh = false;
List<CreateMesh> cm = cgen.FindModules<CreateMesh>();
for (int i = 0; i < MAX_TRACKS; i++)
{
ArrayList coords = Strings2Vec3Arr(tracks[1]);
GameObject instance = InstantiateSectie(coords);
attachCurvySpline(instance, coords);
cgen.Refresh();
foreach (CreateMesh cm_i in cm)
{
cm_i.SaveToScene();
}
}