18-06-2020, 10:14 AM
(This post was last modified: 18-06-2020, 10:15 AM by josemendez.)
(18-06-2020, 10:12 AM)renderlux Wrote: Hi
This looks like it works (no errors)
Code:myMesh.AddComponent<ObiSkinnedCloth>();
ObiSkinnedCloth cloth = myMesh.GetComponent<ObiSkinnedCloth>();
cloth.skinnedClothBlueprint = ScriptableObject.Instantiate(sourceTop);
and I create Solver in Start()
Code:GameObject solverObject = new GameObject("solver", typeof(ObiSolver), typeof(ObiFixedUpdater));
ObiSolver solver = solverObject.GetComponent<ObiSolver>();
ObiFixedUpdater updater = solverObject.GetComponent<ObiFixedUpdater>();
updater.solvers.Add(solver);
But the physics don't work
Is the cloth inside (the hierarchy of) a solver? It won't simulate otherwise.
Does it have a ObiSkinnedClothRenderer component? the cloth mesh won't be updated according to the simulation if it doesn't.