Obi Official Forum
Help Intertwining of ropes in Obi Rope - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Help Intertwining of ropes in Obi Rope (/thread-4296.html)



Intertwining of ropes in Obi Rope - mayktr - 18-07-2024

Hello, I have been working on a mechanic with obi rope for a while. My aim is to prevent the threads from passing through each other and entwining each other. Although I was able to achieve some of this, I could not get it to the level I wanted. Even a simple force causes the ropes to intertwine. Has anyone dealt with this problem before and been able to solve it?



https://drive.google.com/file/d/102LpEO5Z1hSoQFpQeBIEupDg-c-eVLVn/view?usp=sharing

Here is my solver, rope and project settings

[attachment=2149]
[attachment=2148]
[attachment=2147]
[attachment=2146]
[attachment=2145]


RE: Intertwining of ropes in Obi Rope - josemendez - 19-07-2024

(18-07-2024, 11:19 PM)mayktr Wrote: Even a simple force causes the ropes to intertwine.

Hi,

What kind of "force" are you referring to (external force, AddForce(), moving the rope using a transform, etc)? how and when are you applying this force?

Taking a look at your screenshots, I see you have a Rigidbody component added to your rope. This doesn't make any sense: a body can either be rigid or deformable, but not both at once. Adding a rigidbody component to a rope will duplicate a lot of functionality (gravity wil be added twice, external forces will be considered twice, etc) and will yield rather strange behavior.

If your body is rigid (eg a box) use Rigidbody and a Collider of the appropriate shape. If your body is deformable (rope, cloth, softbody, or fluid) use the necessary Obi asset/component, in this case ObiRope.

kind regards,


RE: Intertwining of ropes in Obi Rope - mayktr - 19-07-2024

(19-07-2024, 08:51 AM)josemendez Wrote: What kind of "force" are you referring to (external force, AddForce(), moving the rope using a transform, etc)? how and when are you applying this force?

public void Swerve(Vector3 targetPos, float speed)
{
    Vector3 newPos = Vector3.MoveTowards(selectedGO.transform.position, targetPos, speed * Time.fixedDeltaTime);
    myRigidbody.MovePosition(newPos);
...
}

Here is the code that I am moving my ball. By the way, I am calling this method from FixedUpdate.

I have added ObiRigidbody to my rope but thanks to your advice I have removed both ObiRigidbody and Rigidbody. But still having same problem.

Also how can I get trigger detection with other box colliders with trigger checkbox on?


RE: Intertwining of ropes in Obi Rope - josemendez - 20-07-2024

(19-07-2024, 06:04 PM)mayktr Wrote: public void Swerve(Vector3 targetPos, float speed)
{
    Vector3 newPos = Vector3.MoveTowards(selectedGO.transform.position, targetPos, speed * Time.fixedDeltaTime);
    myRigidbody.MovePosition(newPos);
...
}

Here is the code that I am moving my ball. By the way, I am calling this method from FixedUpdate.

I have added ObiRigidbody to my rope but thanks to your advice I have removed both ObiRigidbody and Rigidbody. But still having same problem.

Also how can I get trigger detection with other box colliders with trigger checkbox on?

Hi,

This isn’t a force of any kind, it will set the position of the sphere while completely ignoring physics. The rope has no option but to follow the ball, since it can't affect/limit its movement in any way once the rope is completely taut.

You need to use forces/accelerations/velocities if you want physical effects to take place, this applies to any physics engine you use. In Obi this can be done by using AddForce on the rope, writing per-particle forces to the solver’s externalForces array, or using dynamic attachments. You’ll find examples of these in the sample scenes, eg: the Crane and FreightLift sample scene use dynamic attachments to rigidbodies, the Firehose sample scene uses externalForces to allow you to click and drag the rope around while respecting physics (the rope won’t overstretch, clip trough other objects or itself).

In your specific case I think you should move the sphere rigidbody using AddForce (and ensuring the rigidbody is not kinematic, otherwise it will ignore forces applied to it!). Dynamic attachments allow forces applied on the rigidbody attached to affect the rope and vice-versa, but for this to work you need to use forces to begin with.

In addition to this, check the collision filters on your rope's control points (select the rope, click the "edit path" button, select the control points and check the "collides with" and "category" values). These can disable collisions between entire portions of the rope, which may be preventing your ropes from colliding with each other.


Let me know if you need further help,

Kind regards,