How do I make a grappling gun?

Can someone help me set a raycast and make a grappling hook?