Hinges can also be configured to actuate rotation, as follows:
Note that both actuated and free spinning rotation can be limited by setting HingeConstraint.LimitsEnabled to true. Also note that if this constraint attaches one part (A) to another part (B) that is anchored or connected to an anchored part (Z), part A will not be locally simulated when interacting with a player.
Sets whether the rotation of the HingeConstraint is actuated and, if so, what kind of actuation it uses.
Specifies the sharpness of the servo motor in reaching the HingeConstraint.TargetAngle.
Sets whether the rotation of the HingeConstraint is actuated and, if so, what kind of actuation.
When ActuatorType is set to None then the hinge can swing freely:
When ActuatorType is set to Motor then the HingeConstraint will attempt to rotate at a constant velocity specified by HingeConstraint.AngularVelocity. The HingeConstraint will apply a torque up to HingeConstraint.MotorMaxTorque to achieve the desired velocity but will be limited by HingeConstraint.MotorMaxAcceleration.
When ActuatorType is set to Servo then the HingeConstraint will attempt to rotate to an angle specified by HingeConstraint.TargetAngle. The HingeConstraint will attempt to rotate towards that goal at a target speed set by HingeConstraint.AngularSpeed. The maximum torque the HingeConstraint is allowed to use to meet these goals is set by HingeConstraint.ServoMaxTorque.
Sets whether the HingeConstraint will limit the range of rotation. If enabled, the constraint will only allow the HingeConstraint.CurrentAngle to be between HingeConstraint.LowerAngle and HingeConstraint.UpperAngle. If the Attachment reach the end of the limited range of rotation then they will stop rotating. If HingeConstraint.Restitution is greater than 0 then the attachments will bounce when they hit the ends of the limited range.
For example, here is the result if LowerAngle is set to -90 and UpperAngle is set to 45. Note that the x-axis of the Attachment in PartA is pointed away from the camera: