Mechanical Constraints

The physics engine includes the following Constraints that behave as conceptual mechanical connections, including hinges, springs, ropes, and more. In addition, various mover constraints are available to exert directional or rotational force upon assemblies.

BallSocketConstraint forces its two attachments into the same position and allows them to freely rotate about all three axes, with optional limits to restrict both tilt and twist
HingeConstraint allows its two attachments to rotate about one axis, with optional assigned power for motor or servo behavior
PrismaticConstraint allows two attachments to slide along one axis but not rotate, with optional assigned power for mechanisms like sliding doors and elevator platforms
CylindricalConstraint allows its attachments to slide along one axis and rotate about another axis, with optional assigned angular and/or linear power
SpringConstraint applies a force on its attachments based on spring and damper behavior, with an optional minimum/maximum length
TorsionSpringConstraint applies torque based on a relative angle and relative angular velocity, in an attempt to bring two axes from two parts together
UniversalConstraint ensures two axes on two assemblies remain perpendicular, useful for applications such as vehicle power transmission to rear drive shafts, robotics, and more
RopeConstraint prevents two attachments from separating further than a defined length, with optional behavior as an extending or contracting winch
RodConstraint keeps two attachments separated by a defined length, with optional limits on rotational tilt
PlaneConstraint moves two attachments into a position/orientation along a plane, and both attachments remain free to translate and rotate unless otherwise constrained
ConstraintDescription
WeldConstraintConnects two BaseParts and ensures they stay in the same relative position and orientation to each other. Even if the two parts are not touching, you can weld them together.
RigidConstraintConnects two Attachments or Bones and ensures they stay in the same relative position/orientation to each other. This flexibility gives it additional functionality beyond WeldConstraint, such as attaching accessories to Attachments on a character rig.
NoCollisionConstraintPrevents collisions between two specific parts, but those parts may still register collisions with the rest of the world. Compared to collision groups, provides a direct way to disable specific collisions, such as the wheel of a car scraping against the car's body.

Constraint Visualization

To accurately visualize constraints in Studio, you can use the following options from the Model tab:

Constraints tools indicated in Model tab

Show Welds — Show WeldConstraints, separately from the visualization of other constraints.

Constraint Details — Show complete visual details of non-weld constraints.

Scale — Relative scale of visualizations.

Creating Constraints

All mechanical constraints must connect one or two Attachments or Bones, except for WeldConstraint and NoCollisionConstraint. When connected to Bones, the constraint will use their animated position and orientation.

To create a mechanical constraint, you can use either the Create tool or the Explorer window.

  1. In the Model tab, access the Create button's picker menu and select the desired constraint type, for example Spring.

    Constraint picker indicated in Studio toolbar
  2. In the 3D viewport, hover over any Part or MeshPart and click to add a new Attachment to the part at the visualized point. Alternatively, hover over and click an existing Attachment or Bone to use it for the constraint.

  3. Most mechanical constraints require a secondary attachment in their functionality, so the tool will typically prompt you to repeat the previous step on another Part, MeshPart, Attachment, or Bone.

    SpringConstraint connecting two attachments
    Completed SpringConstraint connecting two attachments

Physical Simulation

To simulate physics while moving or rotating parts, you can switch to Physical mode in the Model tab, effectively forcing parts to obey physical limitations. For example, if two parts are attached by a RopeConstraint and you drag one part around the scene, the other part will follow as the rope becomes taut.