Alright, the clicking out of bounds issue should be fixed!
I actually took this simplified version of the grappling hook mechanic from a platformer I've been working on, it's in early stages atm and it's used as a mario style powerup.