2 min read

Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.

BallSocket

Note

For an overview on creating, visualizing, and simulating mechanical constraints, including BallSocketConstraint, see Mechanical constraints. Also see Roblox units to understand how Roblox units compare to metric units.

A BallSocketConstraint forces its two attachments into the same position and allows them to freely rotate about all three axes. However, you can enable limits to restrict both tilt and twist.

Limits

You can set limits to restrict both tilt and twist of a ball socket, similar to how a human's head can tilt and turn within a limited axial range. Enabling the LimitsEnabled property exposes the UpperAngle value to restrict tilt within a cone; it also exposes the TwistLimitsEnabled property which, when enabled, lets you restrict twist rotation through the TwistLowerAngle and TwistUpperAngle limits.

Constraint with LimitsEnabled set to true and UpperAngle set to 15

Constraint with LimitsEnabled and TwistLimitsEnabled set to true, TwistLowerAngle set to -60, and TwistUpperAngle set to 0

Note

Enabling LimitsEnabled also exposes the Restitution value which defines the elasticity of the attachments at their tilt and/or twist limits.

Note

When LimitsEnabled is enabled, orientation of a ball socket's attachments affects how it rotates. To ensure rotation occurs around the desired axis, each attachment's Axis, visualized by the yellow arrow, should point in the same direction.