- Home /
Grappling hook springjoint
Hello, and thanks for even considering to help me. I want to make a grappling hook in unity 3d when you click (The tutorials didn't work) and I know you have to send out a raycast, send out a line, and attach a spring joint. I do not fully understand the second last steps, can someone help guide me? The code for the raycast is using UnityEngine; public class GrapplingGun : MonoBehaviour { public float range = 100f; public Camera cam; void Update() { if (Input.GetButtonDown("fire1")) { Grapple(); } void Grapple() { RaycastHit hit; if (Physics.Raycast(cam.transform.position, cam.transform.forward, out hit, range) { //sorry if it didnt format } } } }
Thanks!
Your answer
Follow this Question
Related Questions
Spring joint with gravity 1 Answer
3D cube bounces when dropped from a height. How can I stop that? 1 Answer
Creating 3d planets with terrain and atmosphere 3 Answers
Kinematic behaviour object but with gravity ??? 1 Answer
Player model physics doesn't seem to work properly. Gravity issues maybe? 0 Answers