Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rope going through collider
#1
I setup a rope, a draggable object and a cube (obstacle) with obi collider.

When dragging the rope around the cube (obstacle), it is 2 issues:
1. The most important one: The rope goes through the obstacle, which is of course not wanted
2. Not so important, but nice to fix: When rope is bent around the cube, its not following the shape of the cube, but rather goes partially inside the cube

Here is a video that shows whats going on:
https://youtu.be/a1_0vixUPXQ

Questions is:
1. How to avoid rope to go through the cube ? Most important !!
2. How to improve the issue in issue 2 ?

Note: As you see the rope is stretched, which is necessary for my project.
Reply
#2
Hi!

Obi is a particle-based engine.

This means ropes are not a continuous object, but discretized as a chain of particles. Same for all other Obi actors. When you stretch a rope, the separation between particles increases, which may allow colliders to pass in between them. This will become evident if you add a ObiParticleRenderer component to your rope.

(09-03-2022, 01:01 PM)budwiz Wrote: 1. How to avoid rope to go through the cube ? Most important !!
You might want to use surface collisions to improve contact handling, as it closes gaps between particles.

(09-03-2022, 01:01 PM)budwiz Wrote: 2. How to improve the issue in issue 2 ?
Increase your rope blueprint's resolution. Note that any physics engine you use will discretize your rope (as particles, capsules, tetrahedra, or any other). The finer the discretization, the better it will adapt to other object's shapes, but the costlier the simulation will become.

Many games/engines that require ropes to adapt perfectly to corners simply cheat: instead of simulating the rope, they just keep track of the corners the "rope" is in contact with, and draw straight lines from corner to corner. Then, the last straight line is a simple spring. This is what the ninja rope in the Worms series does, the fishing rod in Umihara Kawase, or the rope in Zen Bound.

Nevertheless, it is impossible to stretch a rope indefinitely: in the real world it would either break, or you wouldn't be able to apply enough force to continue stretching it. You can simulate both outcomes in Obi by A) enabling tearing or B) dynamically attaching the rope to a rigidbody, and applying a force to the rigidbody to stretch the rope.

Another alternative is to change the length of the rope using a cursor, instead of stretching it.
Reply