SlidingBallConstraint
SlidingBallConstraint is the base class for constraints that allow their attachments to slide along an axis but not rotate, including PrismaticConstraint and CylindricalConstraint. This constrains the attachments so that their X axes are collinear but pointing in opposite directions. It also constrains the attachments so that their Y axes are parallel.
When configuring this constraint, it may be helpful to study Roblox Units to understand how Roblox units compare to metric units.
Linear Power
If this constraint's ActuatorType is set to Motor, it attempts to translate the attachments with the goal of reaching Velocity. You can further control this translation through both MotorMaxAcceleration and MotorMaxForce.
If this constraint's ActuatorType is set to Servo, it attempts to translate the attachments to a set separation specified by TargetPosition. This translation is controlled by Speed, LinearResponsiveness, and ServoMaxForce.
Limits
You can set limits to restrict this constraint's sliding range. Enabling the LimitsEnabled property exposes the LowerLimit and UpperLimit values, as well as Restitution which defines the elasticity of the attachments when they reach either limit.
Summary
Properties
Sets whether the translation of the SlidingBallConstraint is actuated and, if so, what kind of actuation.
The current offset between the constraint's Attachments.
Sets whether the SlidingBallConstraint will limit the range of translation.
Specifies the "sharpness" of the linear servo motor in reaching the TargetPosition.
The lower positional limit along the X axis of Attachment0 if LimitsEnabled is true.
The constraint's maximum acceleration when ActuatorType is set to Motor as the constraint attempts to reach its desired Velocity.
The constraint's maximum force when ActuatorType is set to Motor, as the constraint attempts to reach its desired Velocity.
The elasticity of the constraint's Attachments when they reach the end of the range specified by UpperLimit and LowerLimit, assuming LimitsEnabled is set to true.
The constraint's maximum force when ActuatorType is set to Servo, as the constraint attempts to reach its desired Speed.
The constraint's visualized size.
The constraint's desired speed when ActuatorType is set to Servo, as the constraint translates towards its TargetPosition. Measured in studs per second.
The constraint's attempted target position when ActuatorType is set to Servo. Measured in studs.
The upper positional limit along the X axis of Attachment0 if LimitsEnabled is true.
The constraint's attempted velocity when ActuatorType is set to Motor. Measured in studs per second.
Indicates if the constraint is currently active in the world.
The Attachment that is connected to Constraint.Attachment1.
The Attachment that is connected to Constraint.Attachment0.
The color of the constraint.
Toggles whether or not the constraint is enabled.
Toggles the constraint's visibility.
Properties
ActuatorType
Sets whether the translation of the SlidingBallConstraint is actuated and, if so, what kind of actuation.
If ActuatorType is set to None, the joint can slide freely.
If ActuatorType is set to Motor, it attempts to translate the attachments with the goal of reaching Velocity. You can further control this translation through both MotorMaxAcceleration and MotorMaxForce.
If this constraint's ActuatorType is set to Servo, it attempts to translate the attachments to a set separation specified by TargetPosition. This translation is controlled by Speed, LinearResponsiveness, and ServoMaxForce.
LimitsEnabled
Sets whether the SlidingBallConstraint will limit the range of translation. If true, this property exposes the LowerLimit and UpperLimit values, as well as Restitution which defines the elasticity of the attachments when they reach either limit.
LinearResponsiveness
Specifies the "sharpness" of the linear servo motor in reaching the TargetPosition when the derived classes' actuator type is set to Servo. Larger values correspond to faster a response and smaller values results in more damping and a slower response.
MotorMaxAcceleration
The constraint's maximum acceleration when ActuatorType is set to Motor, as the constraint attempts to reach its desired Velocity.
MotorMaxForce
The constraint's maximum force when ActuatorType is set to Motor, as the constraint attempts to reach its desired Velocity.
Restitution
The elasticity of the constraint's Attachments when they reach the end of the range specified by UpperLimit and LowerLimit, assuming LimitsEnabled is set to true. The valid range is between 0–1.
ServoMaxForce
The constraint's maximum force when ActuatorType is set to Servo, as the constraint attempts to reach its desired Speed.
Speed
The constraint's desired speed when ActuatorType is set to Servo, as the constraint translates towards its TargetPosition. Measured in studs per second.
TargetPosition
The constraint's attempted target position when ActuatorType is set to Servo Measured in studs.
Velocity
The constraint's attempted velocity when ActuatorType is set to Motor. Measured in studs per second.