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.
Answer by lgarczyn · Jan 23, 2020 at 09:09 PM
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.
No problem, don't hesitate to ask any questions if you have issues with it.
Your answer
Follow this Question
Related Questions
isKinematic vs RigidbodyType.Kinematic 0 Answers
Chain reaction explosives 0 Answers
Ragdoll falls through ground with animation 0 Answers
How to calculate velocity after collision? 0 Answers
PUN 2 Player glitchy while in air 0 Answers