set the connected anchor of spring joint 2D

i’m ray casting from the player to the object with collider and rigidbody2D and i have hit.point, now i want to set my player springJoint2D’s connected anchor to hit.point however hit.point is world space coordinate
but connected anchor is locale-space coordinate from connected rigidbody i tried to subtract hit.point from connected rigidbody position but it set the position of connected anchor different from hit.point.
any idea?

I’m pretty sure you can just set autoConfigureConnectedAnchor to false, and the set the connected anchor to hit.point

OK i fixed it, it wasn’t that complex that i think for those who may encounter this problem here’s what i did :
i created a empty GameObject and then reference it in my script and whenever i ray cast first set position of empty GameObject to hit.point and then set the parent of the empty GameObject to connected rigidbody now it’s position is the that local space coordinate that i was looking for.
im sure there a better approaches but it was the first thing that comes to my mind