You are most probably tracing for fixing the rope at a wall, then you decide that the rope has the length between that position at the wall and the player.
When swinging with the rope against an edge you can get by this trace the distance between the player and this edge and reset the ropes length between this two points, you have to somehow store this situation for when the player later swings back, because the rope has to 'leave' the edge and get back to the former position at the wall and the former length...