Hey, a while ago I found the Optimized Ropes tool by GOGO GAGA or (Ali Rasheed on Github) but I've run into some issues with disabling and reenabling the rope in different positions. The rope seems to not get recalculated properly and will seemingly snap from its previous position to the current one. But everything in the code (as far as I understand) seems to prevent that, but as I've said on here before I am not the best at math.
I've included a video of the issue. As you can see after the wave effect finishes the rope will snap to its new position. This effect gets worse the further it is moved (I am currently using an object pool of 1 rope just for demonstration).
The way I enable the rope is pretty simple, after the wave effect has finished I just run this segment of code.
if (rope.enabled == false)
{
lenght = currentLenght;
rope.ropeLength = lenght;
rope.RecalculateRope();
rope.enabled = true;
}
ropeStartPoint.position = wrist.position;
As far as I can tell, the RecalculateRope() method should stop this snap from happening but it clearly doesn't. I have tried to call it after enabling the rope but this does not seem to affect anything.
I also tried to use the ResetRope() method, but that only makes the snap effect worse.
Any help with this would be much appreciated, as I am a bit out of my depth on this one. I figured I would have to write a new reset method that takes the new position into account. The link below is the main class for the rope tool in question.
A tool for sharing your source code with the world!