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.

TorsionSpring

Note

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

A TorsionSpringConstraint applies torque based on a relative angle and relative angular velocity. It attempts to bring two axes from two parts together and is useful for hinged swinging doors with a spring-back effect.

Note

Correct orientation of a torsion spring's attachments is important. The constraint will attempt to bring the SecondaryAxis of each attachment, visualized by the orange arrows, into alignment. When building mechanisms like swinging doors, ensure that the secondary axes are perpendicular to the intended axis of rotation.

Damping

The Damping value controls how fast the spring's oscillation dies down. A value of 0 allows the spring to oscillate endlessly, while higher values bring the spring to a rest more quickly.

<video controls src="https://prod.docsiteassets.roblox.com/assets/physics/constraints/TorsionSpring-Damping-0.mp4" alt="Video showing Damping set to 0"></video>

Damping = 0

<video controls src="https://prod.docsiteassets.roblox.com/assets/physics/constraints/TorsionSpring-Damping-50.mp4" alt="Video showing Damping set to 50"></video>

Damping = 50

Stiffness

Stiffness sets the torsional strength of the spring. Higher values create a spring that responds with more force.

Limits

Enabling the LimitsEnabled property exposes the MaxAngle value to restrict the spring's range within a cone; it also exposes the Restitution value which defines the elasticity of the attachments when they reach their limit.