Hello, everyone. I am attempting to make a simple little grappling hook/rope swinging game.
var CJ = this.gameObject.GetComponent(typeof(ConfigurableJoint)) as ConfigurableJoint;
if (Input.GetMouseButtonDown(0))
if (Physics.Raycast(transform.position, Input.mousePosition, 50))
CJ.anchor = RaycastHit.point;
This is the code I have currently. To put it simply, I would like to have it so that the anchor for the configurable joint is set to wherever the player clicks in the game area. I am a complete novice at coding, so, any help and suggestions would be greatly appreciated!