Thanks for these - I had already come across them. Rope2D was essentially doing the same as I was - it’s just code to dynamically create a rope from rigidbody components.
I didn’t see anything that enlightening in the Rope3D stuff - certainly as much as the fixing was concerned. So my solution - after checking out some details of how physics actually worked… which in the main part blew my tiny mind was to use the much simpler idea of verlet integration. Not something I’d heard of before, but it’s a very interesting approach to modelling physics where all you are looking at is a points position and previous position to infer velocity (and then you can add forces onto that like gravity, friction etc)
There’s really useful tutorials I found here
which is a 4 part on Verlet, but is very simple to follow and understand.
Following this, the reason for the stretch is a bit more understandable. Using Verlet Intergration which add a constraint to each link of the rope - basically saying that each link is 50 pixels long for example. During the calculations on the individual points, the length could easily vary, and so you need to adjust things during the calculations. By adding more links, your error rate will increase.
You can combat this by running through the point correction part of you code more than once. This will effectively change your rope from a very stretchy one, to a much tighter one.
However, there’s a trade off here. If you make the rope to tight, then the corrections will spring your rope back far too powerfully.
I’ve messed around and am pretty happy with this 40 link idea. There’s a little stretch there but it’s within the acceptable limits for me.
The main thing is hainvg more control over the movement whereas a righidbody would always do it’s own thing. I’m generating this with line2D right now. I think the better idea is to texture the lines and let them stretch slightly. I still have to add colliders to this and need to work on letting the rope dynamically grow/retract, but I’m at a place where I can move forwards.
I would like to see the pinjoint have an option to actual pin the joint… y’know, its in the name isn’t it?