26-01-2022, 01:56 AM
(26-01-2022, 12:38 AM)MoonBoop Wrote: Im trying to generate an array of blue prints with obi cloth and im running into a problem where the obi cloth coroutine to generate a garment is returning a null value error.Solved, I had set up the parent game object this script was attached to incorrectly, so I was not able to run coroutines.
// generate blueprint:
ObiClothBlueprint[] blueprints = new ObiClothBlueprint[meshData.Length];
for(int i = 0; i < blueprints.Length; i++)
{
blueprints[i] = ScriptableObject.CreateInstance<ObiClothBlueprint>();
blueprints[i].inputMesh = meshData[i].GenerateMesh();
//Debug.Log(blueprints[i].inputMesh.vertexCount);
yield return StartCoroutine(blueprints[i].Generate());
}
I know the input mesh being provided is not null, so im confused as to what is happening.
any help would be much appreciated.