Class · inherits Constraint
SlidingBallConstraint
The base class for constraints that allow their attachments to slide along an axis.
About SlidingBallConstraint
SlidingBallConstraint is the base class for constraints that allow their
attachments to slide along an axis, including PrismaticConstraint and
CylindricalConstraint. The base class does not restrict rotation.
PrismaticConstraint prevents rotation, while
CylindricalConstraint allows rotation about an axis.
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.
Properties 14
ActuatorType
: ActuatorTypeSets whether the translation of theSlidingBallConstraintis actuated and, if so, what kind of actuation.Sets whether the translation of the
SlidingBallConstraintis actuated and, if so, what kind of actuation.If
ActuatorTypeis set toNone, the joint can slide freely.If
ActuatorTypeis set toMotor, it attempts to translate the attachments with the goal of reachingVelocity. You can further control this translation through bothMotorMaxAccelerationandMotorMaxForce.If this constraint's
ActuatorTypeis set toServo, it attempts to translate the attachments to a set separation specified byTargetPosition. This translation is controlled bySpeed,LinearResponsiveness, andServoMaxForce.
CurrentPosition
: floatReadOnlyNotReplicatedThe current offset between the constraint'sAttachments.LimitsEnabled
: booleanSets whether theSlidingBallConstraintwill limit the range of translation.Sets whether the
SlidingBallConstraintwill limit the range of translation. If true, this property exposes theLowerLimitandUpperLimitvalues, as well asRestitutionwhich defines the elasticity of the attachments when they reach either limit.LinearResponsiveness
: floatSpecifies the "sharpness" of the linear servo motor in reaching theTargetPosition.Specifies the "sharpness" of the linear servo motor in reaching the
TargetPositionwhen the derived classes' actuator type is set toServo. Larger values correspond to faster a response and smaller values results in more damping and a slower response.LowerLimit
: floatThe lower positional limit along the X axis ofAttachment0ifLimitsEnabledis true.MotorMaxAcceleration
: floatThe constraint's maximum acceleration whenActuatorTypeis set toMotoras the constraint attempts to reach its desiredVelocity.The constraint's maximum acceleration when
ActuatorTypeis set toMotor, as the constraint attempts to reach its desiredVelocity.MotorMaxForce
: floatThe constraint's maximum force whenActuatorTypeis set toMotor, as the constraint attempts to reach its desiredVelocity.Restitution
: floatThe elasticity of the constraint'sAttachmentswhen they reach the end of the range specified byUpperLimitandLowerLimit, assumingLimitsEnabledis set to true.The elasticity of the constraint's
Attachmentswhen they reach the end of the range specified byUpperLimitandLowerLimit, assumingLimitsEnabledis set to true. The valid range is between 0–1.ServoMaxForce
: floatThe constraint's maximum force whenActuatorTypeis set toServo, as the constraint attempts to reach its desiredSpeed.Size
: floatThe constraint's visualized size.Speed
: floatThe constraint's desired speed whenActuatorTypeis set toServo, as the constraint translates towards itsTargetPosition. Measured in studs per second.TargetPosition
: floatThe constraint's attempted target position whenActuatorTypeis set toServo. Measured in studs.The constraint's attempted target position when
ActuatorTypeis set toServoMeasured in studs.UpperLimit
: floatThe upper positional limit along the X axis ofAttachment0ifLimitsEnabledis true.Velocity
: floatThe constraint's attempted velocity whenActuatorTypeis set toMotor. Measured in studs per second.
SlidingBallConstraint also has every member of Constraint. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.