float MinAngle { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The MinAngle property of the HingeJoint class specifies the minimum angle that the hinge joint is allowed to rotate to. This property is useful for constraining the movement of the joint to a specific range, preventing it from rotating beyond a certain point in the negative direction.

Usage

To use the MinAngle property, you can set it to a desired value in degrees. This value will determine the lower limit of the hinge joint's rotation. Ensure that the MinAngle is less than or equal to the MaxAngle to avoid configuration errors.

Example

// Example of setting the MinAngle property
HingeJoint hingeJoint = new HingeJoint();

// Set the minimum angle to -45 degrees
hingeJoint.MinAngle = -45.0f;

// Ensure the MaxAngle is greater than MinAngle
hingeJoint.MaxAngle = 45.0f;

// Now the hinge joint can rotate between -45 and 45 degrees.