Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Softbody mesh working weird when attached to chain (obi rope)
#1
Gran sonrisa 
I am trying to use obi softbody and obi ropes together but the mesh is getting weird. Basically I have a chain attached to a stand gameObjet and a punchingBag gameObject, this setup working fine but whenever I add softbody component to the punchingBag it either starts moving on it's own weirdly or it becomes a puddle of mesh and fals into the ground.

Here is a drive folder with inspector screenshots, a video showing the problem in play mode and also the project folder if you need:
https://drive.google.com/drive/folders/1...share_link

I've also attached screenshots bellow. If you need more info let me know. Thank you in advance.

Edit: I am using unity 2021.3.1f1 on Windows 10, the assets used are ObiRope and ObiSoftbody.


Attached Files Thumbnail(s)
       
Reply
#2
(08-05-2023, 08:31 PM)eduardoseitz Wrote: I am trying to use obi softbody and obi ropes together but the mesh is getting weird. Basically I have a chain attached to a stand gameObjet and a punchingBag gameObject, this setup working fine but whenever I add softbody component to the punchingBag it either starts moving on it's own weirdly or it becomes a puddle of mesh and fals into the ground.

Here is a drive folder with inspector screenshots, a video showing the problem in play mode and also the project folder if you need:
https://drive.google.com/drive/folders/1...share_link

I've also attached screenshots bellow. If you need more info let me know. Thank you in advance.

Edit: I am using unity 2021.3.1f1 on Windows 10, the assets used are ObiRope and ObiSoftbody.

Hi,

Shape matching constraints are globally disabled in your ObiSolver component. These are the constraints in charge of keeping the overall shape of the softbody (see http://obi.virtualmethodstudio.com/manua...aints.html), if you disable them then particles in the softbody will behave independently of each other, and the softbody will turn to a puddle.

Just enable shape matching constraints. Sonrisa
Reply
#3
(09-05-2023, 11:39 AM)josemendez Wrote: Hi, It solved the puddle of mesh, thank you very much. But now the bag just spins out of control like if the chain was being pulled around.

Here is a video of the problem: https://drive.google.com/file/d/1P5cWqjA...sp=sharing

My settings are everything the same but shape matching enabled (screenshot attached).


Attached Files Thumbnail(s)
   
Reply
#4
Looks like the chains and the bag are colliding with each other, while simultaneously being attached. This will result in a force loop: they can't separate because they're attached, but can't stay attached because collisions try to prevent any penetration.

You can solve this by specifying collision filters so that the end of the chains and the softbody don't collide with each other. See the last bit of:

http://obi.virtualmethodstudio.com/manua...ments.html

Also see "collision filtering" in the manual page regarding collisions:

http://obi.virtualmethodstudio.com/manua...sions.html

kind regards,
Reply
#5
(11-05-2023, 09:56 AM)josemendez Wrote: Looks like the chains and the bag are colliding with each other, while simultaneously being attached. This will result in a force loop: they can't separate because they're attached, but can't stay attached because collisions try to prevent any penetration.

You can solve this by specifying collision filters so that the end of the chains and the softbody don't collide with each other. See the last bit of:

http://obi.virtualmethodstudio.com/manua...ments.html

Also see "collision filtering" in the manual page regarding collisions:

http://obi.virtualmethodstudio.com/manua...sions.html

kind regards,

Almost there. Although I checked the links you posted and read them carefully I couldn't get it fixed but I think your answer about the collisions conflicting makes sense and it's the right direction.
I checked my collision settings and it seems everything is right, do you think there is anything I need to change based on these screenshots? Screenshots: https://drive.google.com/drive/folders/1...share_link

I also noticed that the chain links extend too far apart from each other in playmode, do you know a solution for this? Screenshot: https://drive.google.com/file/d/1GZWzKxe...sp=sharing

Thank you so much for your help so far.
Reply
#6
(17-05-2023, 09:50 PM)eduardoseitz Wrote: Almost there. Although I checked the links you posted and read them carefully I couldn't get it fixed but I think your answer about the collisions conflicting makes sense and it's the right direction.
I checked my collision settings and it seems everything is right, do you think there is anything I need to change based on these screenshots? Screenshots: https://drive.google.com/drive/folders/1...share_link

These only show the settings for the topmost rope, but there's 5 ropes in total? Or are the 4 lower ropes part of the softbody?
In case there's only one rope, it looks fine for me: the lower control point should be set to not collide with the softbody (setting it to collide with nothing is one way to achieve it).

(17-05-2023, 09:50 PM)eduardoseitz Wrote: I also noticed that the chain links extend too far apart from each other in playmode, do you know a solution for this? Screenshot: https://drive.google.com/file/d/1GZWzKxe...sp=sharing

Looks like the mass of the softbody is really high compared to that of the rope(s). Large mass ratios require more substeps to bee solved accurately - like in all physics engines-. An insufficient solver budget will result in spurious compliance (fancy word for unwanted elasticity).

Either use more substeps, reduce the mass of the softbody, or increase the mass of the ropes.

kind regards,
Reply
#7
(18-05-2023, 09:03 AM)josemendez Wrote: These only show the settings for the topmost rope, but there's 5 ropes in total? Or are the 4 lower ropes part of the softbody?
In case there's only one rope, it looks fine for me: the lower control point should be set to not collide with the softbody (setting it to collide with nothing is one way to achieve it).


Looks like the mass of the softbody is really high compared to that of the rope(s). Large mass ratios require more substeps to bee solved accurately - like in all physics engines-. An insufficient solver budget will result in spurious compliance (fancy word for unwanted elasticity).

Either use more substeps, reduce the mass of the softbody, or increase the mass of the ropes.

kind regards,
There is only one rope (the top one) the bottom ones are fakes that look like chains but they are actually part of the punching bag mesh.
The collision is setup right like you commented so I don't know what that spinning bug is, do you think it might be the solver? (screenshots https://drive.google.com/drive/folders/1...IV35vYJiSe)
The second bug I fixed by increasing the mass of the rope. Thank you.
Reply
#8
(18-05-2023, 09:03 AM)josemendez Wrote: These only show the settings for the topmost rope, but there's 5 ropes in total? Or are the 4 lower ropes part of the softbody?
In case there's only one rope, it looks fine for me: the lower control point should be set to not collide with the softbody (setting it to collide with nothing is one way to achieve it).


Looks like the mass of the softbody is really high compared to that of the rope(s). Large mass ratios require more substeps to bee solved accurately - like in all physics engines-. An insufficient solver budget will result in spurious compliance (fancy word for unwanted elasticity).

Either use more substeps, reduce the mass of the softbody, or increase the mass of the ropes.

kind regards,
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.
Reply
#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
#10
I've fixed the project for you (to the extent I could, there's details I can't fix without artistic intervention like the static chain details at the top of the bag being a separate, rigid mesh), let me know an email address to I can send it to you.
Reply