Reference API Roblox

Engine API

Website

Related

Reference API Roblox

AnimationConstraint

Aligns two BaseParts with an animate-able kinematic or force-based joint.

Member index 12

HistoryMember
726AngularDamping: float
726AngularStrength: float
726IsKinematic: bool
726LinearDamping: float
726LinearStrength: float
726MaxForce: float
726MaxTorque: float
726Transform: CFrame
inherited from Constraint
726Active: bool
726Attachment0: Attachment
726Attachment1: Attachment
726Color: BrickColor
726Enabled: bool
726Visible: bool
604GetDebugAppliedForce(bodyId: int): Vector3
604GetDebugAppliedTorque(bodyId: int): Vector3
inherited from Instance
726Archivable: bool
726Capabilities: SecurityCapabilities
726IsInSandbox: bool
726Name: string
726Parent: Instance
726PredictionMode: PredictionMode
726Sandboxed: bool
726UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
707GetDescendants(): Instances
486GetFullName(): string
706GetStyled(name: string, selector: string?): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
698QueryDescendants(selector: string): Instances
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
726children(): Instances
726clone(): Instance
726destroy(): null
726findFirstChild(name: string, recursive: bool = false): Instance
726getChildren(): Instances
726isDescendantOf(ancestor: Instance): bool
726remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
726childAdded(child: Instance)
inherited from Object
726ClassName: string
726className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
726isA(className: string): bool
647Changed(property: string)

Description

An AnimationConstraint constrains its Attachments so that they're offset by Transform.

For backwards compatibility with Motor6D, AnimationConstraint exposes read-only C0, C1, Part0, and Part1 properties to help adopt the AvatarJointUpgrade.

History 39

Members 12

AngularDamping

TypeDefault
float

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.

History 2

AngularStrength

TypeDefault
float

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.

History 2

IsKinematic

TypeDefault
bool

When true, the connected parts follow the Transform perfectly without participating in physics simulation. When false, the connected parts follow the trajectory using forces and torques limited by MaxForce and MaxTorque.

History 2

LinearDamping

TypeDefault
float

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.

History 2

LinearStrength

TypeDefault
float

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.

History 2

MaxForce

TypeDefault
float

Maximum force magnitude the constraint can apply to achieve its goal. Only used if IsKinematic is false.

History 3

MaxTorque

TypeDefault
float

Maximum torque the constraint can use to reach its goal. Only used if IsKinematic is false.

History 3

Transform

TypeDefault
CFrame

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.

History 6

Settings