Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Softbody mesh working weird when attached to chain (obi rope)
#9
(28-05-2023, 02:15 AM)eduardoseitz Wrote: The chain is working thanks to you. I think what is wrong is the Obi Solver settings, could you check it for me please: https://drive.google.com/file/d/15pIRvbp...sp=sharing

In this settings the following bug occurs: https://drive.google.com/file/d/1P5cWqjA...sp=sharing

Thank you for all the help.

Hi,

I took a look at your Unity project, there's some really deep misconceptions at play here (about Obi and Unity as well).

Your punching bag has both a softbody and rigidbody components, a MeshCollider, a ObiCollider, and both a SkinnedMeshRenderer and a MeshFilter. This makes no sense whatsoever: an object can either be soft or rigid, but not both at once.

The Rigidbody component will endow an object with mass, velocity, inertia, etc, and assume it's completely rigid, using whatever Collider component it can find on the object or its hierarchy to define the shape of the object.

ObiSoftbody will also endow an object with mass, velocity, inertia, etc but assume it is soft, and define the shape of the object using the particle blueprint. This is because particles can move somewhat independently from each other, and allow the object to deform.

By adding both components (rigid and soft body), you're applying gravity twice to the object, and simulating it as both rigid and soft using two separate engines (Unity's built-in physics and Obi) which will yield extremely weird results.

MeshCollider is used to define the collision shape of a rigidbody, as such it only should be added to rigidbodies. There's no point in adding it to a softbody, since softbody collision detection is carried out using particles. Placing it on a softbody will mess with collision detection, since the softbody particles in the object will be colliding against the rigid representation of the same object, causing the bag to "dance" around as it collides with itself.

SkinnedMeshRenderer is used to render meshes that deform using a skeleton, such as characters or softbodies. MeshFilter is used to provide a mesh to MeshRenderers, and used to render static meshes (that don't use a skeleton at runtime). Having both on the same object serves no purpose at all, I'd recommend taking a look at Unity'd documentation to clear up the confusion regarding deformable/static meshes and how rigidbodies work.

The solution is to settle on making the punching bag either rigid or soft. If you want it to be soft, remove MeshFilter, Rigidbody, ObiCollider, ObiRigidbody and MeshCollider components from it, leaving only ObiSoftbody, ObiSoftbodySkinner and SkinnedMeshRenderer.  Then attach the softbody to the chain at the top using ObiStitcher (which is designed to stitch particles together) instead of ObiParticleAttachment (which is designed to attach particles to transforms).

let me know if you need further help Sonrisa

kind regards,
Reply


Messages In This Thread
RE: Softbody mesh working weird when attached to chain (obi rope) - by josemendez - 29-05-2023, 08:17 AM