SliderJoint:getSpring

Edit

Returns the spring parameters of the SliderJoint. Use this to make the position limits of the slider "soft". When the motor is active, a separate set of spring parameters can be set on the motor, see SliderJoint:setMotorSpring.

frequency, damping = SliderJoint: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