DistanceJoint:getSpring

Edit

Returns the DistanceJoint's spring parameters. Use this to control how fast the joint pulls the colliders back together at the distance limits.

frequency, damping = DistanceJoint:getSpring()

Arguments

None

Returns

NameTypeDescription
frequencynumber The frequency of the spring, in hertz. Higher frequencies make the spring more stiff. When zero, the spring is disabled.
dampingnumber The damping ratio of the spring.

Notes

Higher frequencies make the spring more stiff. When zero (the default), the spring is disabled and the limits will be as stiff as possible.

The damping ratio controls how quickly the oscillation slows down:

The default damping ratio is 1.

See also