Obi Official Forum
ObiClothBlueprint generate coroutine returning a null value error. - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Cloth (https://obi.virtualmethodstudio.com/forum/forum-2.html)
+--- Thread: ObiClothBlueprint generate coroutine returning a null value error. (/thread-3291.html)



ObiClothBlueprint generate coroutine returning a null value error. - MoonBoop - 26-01-2022

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.

            // 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.


RE: ObiClothBlueprint generate coroutine returning a null value error. - MoonBoop - 26-01-2022

(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.

            // 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.
Solved, I had set up the parent game object this script was attached to incorrectly, so I was not able to run coroutines.