Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Rope not colliding with itself
#1
Hi, I'm trying to make a rope winding over the rotating stick/cylinder. But whatever I do the rope does not self-collide as expected. See the GIF attached. 

- self-collision is enabled. 
- resolution is 0.7 (I've even tried set it to 1, with no effect)

I've tried to increase collision and particle collision constraint iterations, reduce relaxation, play around with substeps and physics timestamps. But without any success. Rope still not winding. Coils are just fall trough each other. 

Could anyone say what I'm doing wrong and if such behaviour ever possible, please? 
Thanks!

[Image: source.gif]
Reply
#2
Hi Marat,

If you're using a rope cursor to extend the length of the rope, there's a known bug that will deactivate self-collisions between newly created particles. Fortunately the fix is easy. Open the ObiRope.cs file, and add this right at the end of the RebuildConstraintsFromElements() method:

Code:
RecalculateRestPositions();

Should look like this:

Quote:    //<...more stuff here...>
               loopClosingBatch.restBends[0] = 0;
               loopClosingBatch.bendingStiffnesses[0] = new Vector2(_maxBending, _bendCompliance);
               loopClosingBatch.ActivateConstraint(0);
           }

           RecalculateRestPositions();

       }// end of RebuildConstraintsFromElements.

Note that the cost of a rope increases with its length. Depending on what your use case is, a particle-based simulator like Obi might be a bad choice. Alternatives exist that, while much more limited, allow to have arbitrarily long cables/ropes with constant cost. Check out our other cable/rope asset if interested: https://assetstore.unity.com/packages/to...tor-133620
Reply
#3
(18-05-2020, 06:25 PM)josemendez Wrote: Hi Marat,

If you're using a rope cursor to extend the length of the rope, there's a known bug that will deactivate self-collisions between newly created particles. Fortunately the fix is easy. Open the ObiRope.cs file, and add this right at the end of the RebuildConstraintsFromElements() method:

Code:
RecalculateRestPositions();

Thanks, it helped! Now the rope behaves as I wanted: 

[Image: source.gif]

Yes, I understand that it might be not a right tool for my needs regarding performance, but just looking for a quick way to make a "proof of concept" of such mechanic before investing in a self-made solution. 

As for the Cable Simulator asset - thanks for the reference, I've missed it as it's not in "Obi family" (at least by naming), looks interesting. But as I see from the description: 

Quote:What it doesn't do:
- Cable self-collision/knotting.
And as you see from the reference and by my initial question - self-collision is important in my case. 

I have another question if you don't mind - is it possible to make exact particles kind of "static" when they touched my reel (rotating cylinder)? By static I mean to stop calculating any constraints other than collisions for such particles so keep them nailed to their position and behave just as colliders on the reel's surface? 

I think, I need to somehow do this manually - generate a mesh with unity colliders on the points where the rope touched the reel and render it in the same way as Obi Rope is rendered and use Obi Rope only as a visualization of the "controller" (I assume, that the player can move the free end of the rope to control the position where the rope should wind over the reel). But it would be perfect, if I can reach this by Obi Rope itself without self-made stuff. 

Thanks again for your asset and support!
Reply