Prismatic
PrismaticConstraint allows two attachments to slide along one axis but not rotate, with optional assigned power for mechanisms like sliding doors and elevator platforms.
For an overview on creating, visualizing, and simulating mechanical constraints, including PrismaticConstraint, see Mechanical constraints. Also see Roblox units to understand how Roblox units compare to metric units.
A PrismaticConstraint creates a rigid joint between two attachments, allowing them to slide along one axis but not rotate. The constraint can also be powered for mechanisms like sliding doors and elevator platforms.
Orientation of a prismatic's attachments affects how it will move. To ensure movement occurs along the desired axis, each attachment's Axis, visualized by the yellow arrow, should point in the same direction.
Linear power#
If a prismatic'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 a prismatic'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 the sliding range a prismatic. 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.