Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ObiClothBlueprint generate coroutine returning a null value error.
#1
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.
Reply
#2
(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.
Reply