Class
AnimationConstraint
Aligns two BaseParts with an animate-able kinematic or
force-based joint that supports physical simulation (ragdoll, arm strength).
The default joint type for R15 avatar rigs.
Replaces Motor6D for Avatar rigs#
As part of the
Avatar Joint Upgrade,
AnimationConstraint is the replacement for Motor6D in
R15 player character rigs.
When AvatarJointUpgrade is enabled
(the default for new experiences), player characters spawn with
AnimationConstraints instead of Motor6Ds. Unlike Motor6D, AnimationConstraint
supports both kinematic animation and force-based physical simulation —
enabling ragdoll physics, arm strength, and other physically simulated
character movement without rebuilding the rig.
Migrating from Motor6D#
If you have existing code that uses Motor6D for character rigs, note these key differences. See also the Phase 2 migration recommendations.
- Finding joints: Use
:FindFirstChildWhichIsA("AnimationConstraint")instead of:FindFirstChildOfClass("Motor6D"). For code that must support both old and new rigs, check for AnimationConstraint first, then fall back to Motor6D. - C0, C1, Part0, Part1: These properties exist on AnimationConstraint as
read-only aliases for backwards compatibility. They map to
Attachment0.CFrame,Attachment1.CFrame,Attachment0.Parent, andAttachment1.Parentrespectively. Do not attempt to write to them. - Do not modify RigAttachment.CFrame directly — this disrupts animation retargeting and causes performance issues.
- Transform: Works identically to
Motor6D.Transform— theAnimatorwrites to it each frame. Layer procedural animations by multiplying intoTransformduringRunService.PreSimulation, which stacks with active animation tracks without breaking retargeting. - IsKinematic: When
true(default), behavior is equivalent to Motor6D. Set tofalseto enable force-based physical simulation. - Type checks:
animConstraint:IsA("Motor6D")returnsfalse. Update anyIsA("Motor6D")guards to also accept"AnimationConstraint". - Server replication: Instead of setting C0 on the server, use client-side
animation evaluation and synchronize data through custom Attributes or
UnreliableRemoteEvent.
Example: Procedural neck rotation#
-- Before (Motor6D): writing to C0 directly
local originalC0 = neck.C0
RunService.RenderStepped:Connect(function()
neck.C0 = originalC0 * computeNeckRotation()
end)
-- After (AnimationConstraint): multiplying into Transform during PreSimulation
RunService.PreSimulation:Connect(function()
if not animator.EvaluationThrottled then
neck.Transform = computeNeckRotation() * neck.Transform
end
end)Description#
An AnimationConstraint constrains its Attachments so that
they're offset by Transform. When
IsKinematic is true, the parts
follow the transform perfectly (identical to Motor6D behavior). When false,
the constraint applies forces and torques limited by
MaxForce and
MaxTorque, enabling physically simulated
character movement.
Properties 8#
AngularDampingfloat | Damping ratio for the rotational part of the constraint. Higher values reduce oscillation around the target orientation.ReadSafe |
AngularStrengthfloat | Controls how rigidly the constraint enforces the rotational part of its
target Transform. Higher values
track the target orientation more stiffly.ReadSafe |
IsKinematicboolean | Toggles whether the constraint is kinematic or physically simulated.ReadSafe |
LinearDampingfloat | Damping ratio for the translational part of the constraint. Higher values reduce oscillation around the target position.ReadSafe |
LinearStrengthfloat | Controls how rigidly the constraint enforces the translational part of its
target Transform. Higher values
track the target position more stiffly.ReadSafe |
MaxForcefloat | Maximum force magnitude the constraint can apply to achieve its goal.ReadSafe |
MaxTorquefloat | Maximum torque the constraint can apply to reach its goal.ReadSafe |
TransformCFrame | Describes the current animation offset of the constraint joint.ReadSafe |
AngularDamping: float#
ReadSafe
The damping ratio (ζ) applied to the rotational part of the constraint.
Only used if IsKinematic is
false.
A value of 1 corresponds to critical damping, where the constraint
reaches its target orientation as fast as possible without overshoot in
the absence of other forces or constraints. Values less than 1 are
under-damped and oscillate around the target before settling. Values
greater than 1 are over-damped and approach the target more slowly
without oscillation. A value of 0 applies no angular damping, causing
the constraint to oscillate.
Even with this property set to 1, an AnimationConstraint at the root
of a multi-body mechanism may still exhibit low-frequency oscillation
because it does not "see" the full effective mass of the downstream chain.
You can compensate by increasing both
AngularStrength and
AngularDamping beyond their defaults.
AngularStrength: float#
ReadSafe
Controls how rigidly the constraint enforces the rotational part of its
target Transform. Only used if
IsKinematic is false. The
resulting torque is capped by
MaxTorque.
AngularStrength is defined as a normalized natural frequency,
AngularStrength = f / 60, where f is the target natural frequency in
Hz. The default value of 1 corresponds to a target frequency of 60 Hz
and produces strong tracking of the target orientation. A value of 0
applies no torque. Values less than 1 produce a softer, more compliant
rotational response, and values greater than 1 produce a stiffer
response.
Use values significantly greater than 1 with caution, as they may cause
the simulation to become unstable.
IsKinematic: boolean#
ReadSafe
LinearDamping: float#
ReadSafe
The damping ratio (ζ) applied to the translational part of the constraint.
Only used if IsKinematic is
false.
A value of 1 corresponds to critical damping, where the constraint
reaches its target position as fast as possible without overshoot in the
absence of other forces or constraints. Values less than 1 are
under-damped and oscillate around the target before settling. Values
greater than 1 are over-damped and approach the target more slowly
without oscillation. A value of 0 applies no linear damping, causing the
constraint to oscillate.
LinearDamping has no effect when
LinearStrength is 0.
LinearStrength: float#
ReadSafe
Controls how rigidly the constraint enforces the translational part of its
target Transform. Only used if
IsKinematic is false. The
resulting force is capped by
MaxForce.
LinearStrength uses the same normalized natural frequency definition as
AngularStrength,
LinearStrength = f / 60, where f is the target natural frequency in
Hz. The default value of 1 corresponds to a target frequency of 60 Hz
and produces strong tracking of the target position. A value of 0
applies no force. Values less than 1 produce a softer, more compliant
positional response, and values greater than 1 produce a stiffer
response.
Splitting angular and linear parameters lets you make orientation tracking
stiff while keeping positional tracking soft, or vice-versa. As with
AngularStrength, use values
significantly greater than 1 with caution, as they may cause the
simulation to become unstable.
MaxForce: float#
ReadSafe
Maximum force magnitude the constraint can apply to achieve its goal. Only
used if IsKinematic is false.
MaxTorque: float#
ReadSafe
Maximum torque the constraint can use to reach its goal. Only used if
IsKinematic is false.
Transform: CFrame#
ReadSafe
The internal CFrame that is manipulated when the constraint is
being animated.
Note that AnimationConstraint transforms are not applied immediately,
but rather as a batch in a parallel job after
RunService.PreSimulation, immediately before physics steps. The
deferred batch update is much more efficient than many immediate updates.
If the AnimationConstraint is part of an animated model with an
Animator, then Transform is
usually overwritten every frame by the Animator after
RunService.PreAnimation and before
RunService.PreSimulation.
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild