- Home /
How to get the World position of a connectedAnchor? (2d)
If i have ObjectA that has the joint attached to ObjectB, then i would usualy do: ObjectB.position + joint.connectedAnchor to get its world Position, but this wont work if ObjectB is rotated.
Comment
Answer by JedBeryll · May 14, 2016 at 03:04 PM
Vector3 jointPos = new Vector3(joint.connectedAnchor.x, joint.connectedAnchor.y, joint.connectedAnchor.z);
Vector3 worldPos = ObjectA.transform.TransformPoint(jointPos); //or ObjectB if B has the joint component
Does this help?
Your answer
![](https://koobas.hobune.stream/wayback/20220612080803im_/https://answers.unity.com/themes/thub/images/avi.jpg)