11-05-2023, 10:11 AM
(This post was last modified: 11-05-2023, 10:11 AM by josemendez.)
(11-05-2023, 03:28 AM)Balin Wrote: 1. How does one increase the speed the rope flings back after being broken? I would assume it's tied to the tension, but I'm not 100% sure how to increase the tension without shrinking the rope (see below), which is what I saw suggested on another forum post here. Ideally I'd like a different way of doing this.
Tension (or rather, strain) is defined as the ratio between the rope's rest length and its current length:
Code:
float tension =rope.CalculateLength() / rope.restLength;
So the only ways to increase tension are to either stretch the rope more to increase its current length, or reduce its rest length.
You could also just set the velocity of the particles at either end of the cut, which allows you to control the exact magnitude and direction they fling back. See:
http://obi.virtualmethodstudio.com/manua...icles.html
(11-05-2023, 03:28 AM)Balin Wrote: 2. After breaking the rope, it seemingly gets a lot smaller than its original size. See the images attached. In the custom script I wrote, I use a Cursor to reduce the size of the rope at the start so that the tension is increased. However, after breaking, it seems to get much smaller than what I set it to.
Ideally I would like the rope to maintain its original length after being broken, so it could fling back and potentially reach its full length in the opposite direction.
You're reducing the length of the rope via the cursor, so it won't keep its original length after being torn: it will keep the rest length you set by calling cursor.ChangeLength().
Calling rope.Tear() directly like you do in TearRope() will tear the rope at a specific element, regardless of its length. There's no need to increase tension via reducing its rest length with a cursor.
kind regards,