Distance Joint 2D

The Distance Joint 2D component allows two Sprite objects controlled by rigidbody physics to be attached together to keep them a fixed distance apart. Note that unlike the Spring Joint 2D, the Distance Joint is rigid and does not allow the distance between the objects to vary.

Collide ConnectedCan the two connected objects collide with each other?
Connected RigidbodyThe other Rigidbody2D object that the one with the joint is connected to. If this is null then the othen end of the joint will be fixed at a point in space.
AnchorCoordinate in local space where the end point of the joint is attached.
Connected AnchorCoordinate in the other object's local space where its end of the joint is attached.
DistanceThe distance that the joint keeps between the two objects.


Both objects connected by the joint must have a Rigidbody 2D component attached (or alternatively, the other end of the joint can be fixed in space by setting Connected Rigidbody to null). The ends of the joint can rotate relative to the objects but the distance between them will be kept constant.

Page last updated: 2013-08-16