Are you thinking a pull grapple hook in the style of this (not my project, not my sounds), or a swing hook, in the style of Karlson? For a pull grappling hook, they have a GitHub repo with the code and math to make it work (I have used it, and with a few edits, it works well). If you want a swing hook, you can use that as a template and when you start hooking, set rest_length to the length from the grapple point - 2 or so.