Obi Official Forum
Help I can't twine this object with a rope and tear the 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 I can't twine this object with a rope and tear the rope (/thread-2236.html)



I can't twine this object with a rope and tear the rope - Warren - 11-05-2020

What should I do??

This is some images:
https://docs.google.com/document/d/1e8dON2QjLVv3ektzrenyqtJJggkiVBzyYhzHmz6bA9s/edit?usp=sharing


RE: I can't twine this object with a rope and tear the rope - josemendez - 11-05-2020

(11-05-2020, 08:19 AM)Warren Wrote: What should I do??

This is some images:
https://docs.google.com/document/d/1e8dON2QjLVv3ektzrenyqtJJggkiVBzyYhzHmz6bA9s/edit?usp=sharing

You're overstretching the rope, so at some point it will of course miss collisions. Add a ObiParticleRenderer component to it, the problem will become immediately obvious.

You need to increase the length of the rope when pulling from it, or use a longer rope.

Of you want the rope to tear before stretching it so much, decrease its tear resistance.


RE: I can't twine this object with a rope and tear the rope - Warren - 11-05-2020

(11-05-2020, 08:31 AM)josemendez Wrote: You're overstretching the rope, so at some point it will of course miss collisions. Add a ObiParticleRenderer component to it, the problem will become immediately obvious.

You need to increase the length of the rope when pulling from it, or use a longer rope.

Of you want the rope to tear before stretching it so much, decrease its tear resistance.

How to check if it is pulling?I want to increase the length when it is overstretching


RE: I can't twine this object with a rope and tear the rope - josemendez - 11-05-2020

(11-05-2020, 09:23 AM)Warren Wrote: How to check if it is pulling?

You could simply calculate strain. Strain is a measure of how far from its rest "shape" a material is. So a strain > 1 indicates the rope is overstretched, a strain < 1 indicates compression, and 1 indicates no strain at all.

Code:
float strain = rope.CalculateLength() / rope.restLength;


Note however that using the strain to drive a rope cursor won't pull the rope back, keeping it tense at all times. I think you're going for a "Rope Around" type of game: the rope is simply longer than you see on screen, a rigidbody weight is pulling downwards. This keeps the rope tense at all times, allows the rope to become "longer" when you pull, and does not require dynamic resizing.


RE: I can't twine this object with a rope and tear the rope - Warren - 11-05-2020

(11-05-2020, 09:28 AM)josemendez Wrote: You could simply calculate strain. Strain is a measure of how far from its rest "shape" a material is. So a strain > 1 indicates the rope is overstretched, a strain < 1 indicates compression, and 1 indicates no strain at all.

Code:
float strain = rope.CalculateLength() / rope.restLength;


Note however that using the strain to drive a rope cursor won't pull the rope back, keeping it tense at all times. I think you're going for a "Rope Around" type of game: the rope is simply longer than you see on screen, a rigidbody weight is pulling downwards. This keeps the rope tense at all times, allows the rope to become "longer" when you pull, and does not require dynamic resizing.

Thanks,I got it! And I fount that reducing the blueprint's thickness is also helpful.