I am trying to make a 3D grappling hook and need help getting started

Hi, I am trying to make a 3D grappling hook for my project but don’t know how to get started. I want to make the grappling hook be able to attach to an object which has a specific tag attached to it, I also want it to be something that lets you swing to the other side. For example, I want to be able to click on an object and swing to the other side of it. Like Spider-Man technically. Any help would be gratefully appreciated.

First, look into Physics.Raycast.

This will allow you to find the object the user is aiming at.


Once that is done, you have many possibilities. The easiest would be a SpringJoint. Attach it to the target and your player character, and reduce the maximum distance of the joint to go up.

Your character needs to be a non-kinematic rigidbody though, and your movement script needs to use Rigidbody.AddForce or Rigidbody.velocity to move around.