The x position of the first anchor point, in world coordinates.
y1
number
The y position of the first anchor point, in world coordinates.
z1
number
The z position of the first anchor point, in world coordinates.
x2
number
The x position of the second anchor point, in world coordinates.
y2
number
The y position of the second anchor point, in world coordinates.
z2
number
The z position of the second anchor point, in world coordinates.
Returns
Name
Type
Description
joint
DistanceJoint
The new DistanceJoint.
Arguments
Name
Type
Description
colliderA
Collider
The first collider to attach the Joint to.
colliderB
Collider
The second collider to attach the Joint to.
first
Vec3
The first anchor point, in world coordinates.
second
Vec3
The second anchor point, in world coordinates.
Returns
Name
Type
Description
joint
DistanceJoint
The new DistanceJoint.
Notes
A distance joint tries to keep the two colliders a fixed distance apart. The distance is determined by the initial distance between the anchor points. The joint allows for rotation on the anchor points.