I can’t get max distance to work correctly when set at runtime.
It only appears to work if set in the inspector during edit time, when distances are known.
No matter what, if I set “distanceJoint.distance = some value” at runtime, the joint ignores maxDistance only and always attempts to maintain that distance I set.
Might submit a bug report