I've implemented a grappling hook for my character, however I'm struggling to work out how to make the grappling hook work in a nice way. Currently the player can end up just swinging around on it forever (see attached video). Here's the code I am using for the grappling hook:
if grappling_hook_position:
velocity += (grappling_hook_position - global_position).normalized() * grapple_speed * delta
velocity += gravity_vector * gravity * delta
I've played around with higher grapple_speed values, but that just makes the player get pulled too quickly by the hook. Has anyone got any ideas on how this can be improved? I've been looking at the code from Teeworlds (https://github.com/teeworlds/teeworlds/blob/a1911c8f7d8458fb4076ef8e7651e8ef5e91ab3e/src/game/gamecore.cpp#L270-L291), as they don't have this issue, but it seems basically the same as my code.