How to set anchor position in hinge joint 2D?

I am trying to create a 2D chain in which every part is connected to the part above.

‘startPoint’ is the 1st part and ‘newNode’ is the second.

both has a hingejoint2D component and Rigidbody2D component.

here is how i try to connect them.

HJ=newNode.GetComponent<HingeJoint2D>();
HJ.connectedBody=startPoint.GetComponent<Rigidbody2D>();
HJ.connectedAnchor.Set(0,1);
HJ.anchor.Set(0,1);

the connectedBody changes to startPoint Rigidbody2D, but the connectedBody x and y stay at 0

why this is not working? and what is the correct way to change the anchor position?

it was a dumb mistake, this is what I ended up doing:

HJ.connectedAnchor=new Vector2(0,1f);