Error CS0120 problem

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!

Line 5 is wrong. point is a property of an RaycastHit Object, not the RaycastHit class itself. You need to use the Physics.Raycast version with the out hit parameter. Create a RaycastHit variable before raycasting and use it as the out parameter. Then you can access point from that.

Btw.:

var CJ = this.gameObject.GetComponent(typeof(ConfigurableJoint)) as ConfigurableJoint;

==

car CJ = gameObject.GetComponent<ConfigurableJoint>();