23-08-2019, 10:47 AM
(This post was last modified: 23-08-2019, 10:48 AM by josemendez.)
(23-08-2019, 10:16 AM)aznaf Wrote: Thank you for your reply, but I couldn't find a scene named "RuntimeCloth".
Are we still talking about Obi Softbody
My apologies, since you were talking about character skin, I assumed we were talking about ObiCloth. Didn't even realize we are in the ObiSoftbody subforum .
Same thing applies to soft bodies though. Keep in mind that softbody generation involves two steps:
generate the particle representation using a skinned mesh, then bind another skinned mesh to it via ObiSoftbodySkinner. Both meshes don't need to be the same one.
I assume you use the same mesh for both generation and skinning. Once you have your bone scale baked into your shared mesh vertices as I described in the previous post (which is outside of the scope of Obi), generating the soft body is done by calling the GeneratePhysicRepresentationFromMesh coroutine.
Code:
yield return softbody.StartCoroutine(actor.GeneratePhysicRepresentationForMesh());
After this coroutine is completed, then bind the skin by calling the skinner's BindSkin coroutine:
Code:
yield return skinner.StartCoroutine(skinner.BindSkin());
Finally, assuming your softbody has been assigned a solver, add it to the solver to start simulation:
Code:
softbody.AddToSolver(null);