Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Rope goes inside collider when stretched
#1
Hello, I'm using Obi Rope for simulating wrapping around pins, gameplay and the problem is that my rope goes inside collider, I will attach screenshots of settings and also a video of the problem!

I'm pretty sure that I need to activate some setting to have maybe more "stretchy" or more "Wrappy" rope but I can't exactly understand shat should I activate for that

https://www.youtube.com/watch?v=5HnJi0pdI0I

Here is a link for the problem in the video, also I'm attaching my settings.


I tried moving my sphere with rigid body and with transform in both cases it's same, I assume that there is some setting to turn on on the rope.
Reply
#2
Hi,

It passes trough the collider simply because you're overstretching it.

Ropes are made of a fixed number of particles, and have a certain rest length. If you force the rope to stretch past its length, particles will separate from each other and leave gaps in-between trough which other objects can pass. If you add a ObiParticleRenderer component to your rope, particles will be rendered and this issue will become obvious to the naked eye.

Use a dynamic attachment to attach the rope to the sphere, and use forces to move the sphere. This will allow the rope to apply forces on the sphere once it's completely stretched, and resist being arbitrarily stretched. It's important for the attachment to be dynamic. Otherwise, the rope won't resist stretching. See:
http://obi.virtualmethodstudio.com/manua...ments.html
Reply
#3
(14-10-2021, 07:43 AM)josemendez Wrote: Hi,

It passes trough the collider simply because you're overstretching it.

Ropes are made of a fixed number of particles, and have a certain rest length. If you force the rope to stretch past its length, particles will separate from each other and leave gaps in-between trough which other objects can pass. If you add a ObiParticleRenderer component to your rope, particles will be rendered and this issue will become obvious to the naked eye.

Use a dynamic attachment to attach the rope to the sphere, and use forces to move the sphere. This will allow the rope to apply forces on the sphere once it's completely stretched, and resist being arbitrarily stretched. It's important for the attachment to be dynamic. Otherwise, the rope won't resist stretching. See:
http://obi.virtualmethodstudio.com/manua...ments.html


Thanks for the answer, actually the attachment is dynamic, Can I make rope longer when I'm stretching it, to avoid overstretching? So Rope will become longe and there will not be overstretching case?
Reply
#4
(14-10-2021, 10:36 AM)davidsedrakyan Wrote: Thanks for the answer, actually the attachment is dynamic,

Then the only possible cause for this is that you're moving the ball by setting its transform, instead of applying forces. If you force the ball to be at a specific location, you're ignoring any forces applied by the rope via the attachment.

Quote:Can I make rope longer when I'm stretching it, to avoid overstretching? So Rope will become longe and there will not be overstretching case

Yes, you can use a cursor to make the rope longer:
http://obi.virtualmethodstudio.com/manua...ursor.html

Or have a certain amount of pre-existing rope like in the included "WrapTheRope" sample scene (which pretty much does exactly what you're looking for: wrap a rope around pegs)
Reply
#5
(14-10-2021, 10:45 AM)josemendez Wrote: Then the only possible cause for this is that you're moving the ball by setting its transform, instead of applying forces. If you force the ball to be at a specific location, you're ignoring any forces applied by the rope via the attachment.


Yes, you can use a cursor to make the rope longer:
http://obi.virtualmethodstudio.com/manua...ursor.html

Or have a certain amount of pre-existing rope like in the included "WrapTheRope" sample scene (which pretty much does exactly what you're looking for: wrap a rope around pegs)

Okay! I finally found a solution, I need to make rope longer if it's stretched too much, is there any way that I can get stretched force maybe ? To Make the Rope longer if it's stretched too much?
Reply
#6
(14-10-2021, 12:02 PM)davidsedrakyan Wrote: Okay! I finally found a solution, I need to make rope longer if it's stretched too much, is there any way that I can get stretched force maybe ? To Make the Rope longer if it's stretched too much?

You can simply check its current length vs its rest length:
Code:
float strain = rope.CalculateLength() / rope.restLength;
Reply
#7
(14-10-2021, 12:17 PM)josemendez Wrote: You can simply check its current length vs its rest length:
Code:
float strain = rope.CalculateLength() / rope.restLength;

Thanks! Yep, will check it out!
Reply