User avatar
Site Admin
Roblox mechanical constraints: hinges, motors, springs, and welds
Roblox mechanical constraints: hinges, motors, springs, and welds

Constraints are the building blocks of physical mechanisms in Roblox. They connect parts together and define how they move relative to each other. If you have ever wanted to build a door that swings, a car that rolls, or a platform that slides, you need to understand mechanical constraints.

The constraint family

Roblox has two types of constraints. Mechanical constraints act like real world connections: hinges, springs, ropes, and welds. Mover constraints apply force or torque to move an assembly: align position, align orientation, and linear velocity.[1]

This guide covers the mechanical constraints. They are the ones you will use most often for mechanisms.

WeldConstraint

The simplest constraint. It locks two parts together so they stay in the same relative position and orientation, even if they are not touching.[1]

Use welds for static assemblies: a car body, a tool handle, a piece of furniture. A welded part behaves as a single assembly. If you anchor one part, the whole assembly becomes static.

HingeConstraint

A hinge allows two attachments to rotate about one axis. It can also be powered to behave like a motor or servo.[1]

Set ActuatorType to Motor to make it spin at a constant angular velocity. Set it to Servo to rotate toward a target angle. You can enable limits to restrict the rotation range, which is perfect for doors that should only swing open or closed.

The orientation of the attachments matters. Each attachment's Axis property, shown as the yellow arrow in Studio, should point in the same direction for the hinge to rotate around the desired axis.[2]

PrismaticConstraint

A prismatic constraint lets two attachments slide along one axis but not rotate. It is the right choice for sliding doors, elevator platforms, and pistons.[1]

Like the hinge, it can be powered. Set ActuatorType to Motor for continuous sliding or Servo for position based movement.

SpringConstraint and RopeConstraint

A spring applies force based on spring and damper behavior. It tries to keep two attachments at a target distance. Use it for suspension, shock absorbers, and bouncy platforms.[1]

A rope prevents two attachments from separating further than a defined length. It behaves like a rope: no force when slack, resistance when taut. You can set it to act as a winch that extends or contracts.[1]

BallSocketConstraint

A ball socket forces two attachments into the same position but allows free rotation on all three axes. It is the joint you want for vehicle suspension, robotic arms, and camera rigs.[1]

You can add optional limits to restrict tilt and twist, giving you control over how far the joint can move.

How to create constraints in Studio

Use the Constraint tool in the Model tab. Click on a BasePart to create an attachment, then click on another part to connect them. Studio visualizes each constraint with a distinct icon so you can see what you have built.[1]

To simulate physics while editing, switch from Geometric mode to Physical mode in the toolbar. This forces parts to obey physical limitations. If you drag a part connected by a rope, the other part follows when the rope becomes taut.[1]

Source
[1] Mechanical constraints | Roblox Creator Documentation
[2] Hinge constraint | Roblox Creator Documentation