Hi. I've recently upgraded to Obi 7 and believe I've encountered a bug in the "ObiRopeCursor" class. Specifically, I'm able to increase the length of a rope indefinitely.
The issue arises when the maximum number of particles is reached. As the rope's length continues to increase, additional length is added to "m_CursorElement.restLength", but there appears to be no limit in place. This causes a section of the rope to appear as a straight line, which doesn't seem intended.
To confirm, I replicated this issue in the Crane example scene within a fresh Unity project with Obi 7 installed.
I found a potential solution by modifying the code on line 208 in the Rope_OnSimulate method:
Original Code (Line 208):
Proposed Solution:
This change ensures that the 'restLength' does not exceed the 'interParticleDistance', preventing the unintended straight-line section of the rope.
The issue arises when the maximum number of particles is reached. As the rope's length continues to increase, additional length is added to "m_CursorElement.restLength", but there appears to be no limit in place. This causes a section of the rope to appear as a straight line, which doesn't seem intended.
To confirm, I replicated this issue in the Crane example scene within a fresh Unity project with Obi 7 installed.
I found a potential solution by modifying the code on line 208 in the Rope_OnSimulate method:
Original Code (Line 208):
Code:
// Line 208
if (lengthChange > 0)
m_CursorElement.restLength += lengthChange;
Proposed Solution:
Code:
if (lengthChange > 0 && m_CursorElement.restLength < rope.ropeBlueprint.interParticleDistance)
{
m_CursorElement.restLength = Mathf.Min(m_CursorElement.restLength + lengthChange, rope.ropeBlueprint.interParticleDistance)
}
This change ensures that the 'restLength' does not exceed the 'interParticleDistance', preventing the unintended straight-line section of the rope.