Rope Swinging in 2D

I’m trying to implement rope in my game, but currently having an issue with the swinging part. I tried googling and searching here, but everything either applies to 3D (no FixedJoint in 2D) or I can’t get working (parenting, DistanceJoint2D, etc).

I believe the issue revolves around having rectangular segments for the rope. I move the player based on the attached rope segment’s movement when swinging, but the difference from the middle of the rope segment compared to the difference from the very bottom of the segment is significant. It looks like this is what causes the player to seemingly not move with the rope and glitch out.

Does anyone have previous experience with rope physics in Unity2D or some advice on what to try next? Thank you.

Link to source code for reference: GitHub - EricFreeman/LightGame: A physics based puzzle platformer in Unity3D.

I switched the player to adjust its movement based on the middle rope segment that it’s colliding with. This seemed to make it more accurate, but still has and issues (especially when you hit a wall while swinging).

Also, here is my attempt to get DistanceJoint2D working to no avail: Trying to get distancejoint2d working for rope climbing. · EricFreeman/LightGame@86950fa · GitHub