Obi Official Forum

Full Version: ObiClothBlueprint generate coroutine returning a null value error.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
(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.