Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


DistanceJoint2D

Joint that keeps two Rigidbody2D objects a fixed distance apart.
Read time 6 minutesLast updated 2 days ago

Definition

public sealed class DistanceJoint2D : AnchoredJoint2D

Remarks

Note that unlike the SpringJoint2D component, the distance separating the objects is truly fixed and does not allow for any stretching.
Additional Resources: HingeJoint2D, SliderJoint2D, SpringJoint2D

Properties

Property

Description

autoConfigureDistanceShould the
distance
be calculated automatically?
distanceThe distance separating the two ends of the joint.
maxDistanceOnlyWhether to maintain a maximum distance only or not. If not then the absolute distance will be maintained instead.

Inheritance

Inherited Members

Operators

Operator

Description

operator ==Compares two object references to see if they refer to the same object.
boolDetermines whether the object exists.
operator !=Compares if two objects refer to a different object.