float MinLength { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The MinLength property of the SpringJoint class specifies the minimum length that the spring joint is allowed to contract to. When the joint reaches this minimum length, it behaves similarly to a rigid rod, preventing further contraction. This property is useful for defining the lower limit of the spring's extension, ensuring that the connected objects do not come too close together.

Usage

To use the MinLength property, you can set it to a desired value that represents the minimum allowable length of the spring joint. This value is a float and should be set according to the specific requirements of your physics simulation.

For example, if you want the spring joint to act like a rod when it contracts to a length of 1.0 units, you would set MinLength to 1.0.

Example

// Example of setting the MinLength property on a SpringJoint
SpringJoint springJoint = new SpringJoint();
springJoint.MinLength = 1.0f;

// This sets the minimum length of the spring joint to 1.0 units.
// The spring will not contract beyond this length, acting like a rod.