@@ -7,14 +7,77 @@ type: class
77memory_category : BaseParts
88summary : |
99 Aligns two `Class.BasePart|BaseParts` with an animate-able kinematic or
10- force-based joint.
10+ force-based joint that supports physical simulation (ragdoll, arm strength).
11+ The default joint type for R15 avatar rigs.
1112description : |
12- An `AnimationConstraint` constrains its `Class.Attachment|Attachments` so that
13- they're offset by `Class.AnimationConstraint.Transform|Transform`.
13+ #### Replaces Motor6D for Avatar rigs
14+
15+ As part of the
16+ [Avatar Joint Upgrade](https://devforum.roblox.com/t/avatar-joint-upgrade-for-physically-simulated-character-movement-is-now-live/4298561),
17+ `AnimationConstraint` is the **replacement for `Class.Motor6D`** in R15 player
18+ character rigs. When
19+ `Class.StarterPlayer.AvatarJointUpgrade|AvatarJointUpgrade` is enabled (the
20+ default for new experiences), player characters spawn with
21+ AnimationConstraints instead of Motor6Ds. Unlike Motor6D, AnimationConstraint
22+ supports both kinematic animation and force-based physical simulation —
23+ enabling ragdoll physics, arm strength, and other physically simulated
24+ character movement without rebuilding the rig.
25+
26+ #### Migrating from Motor6D
27+
28+ If you have existing code that uses Motor6D for character rigs, note these key
29+ differences. See also the
30+ [Phase 2 migration recommendations](https://devforum.roblox.com/t/avatar-joint-upgrade-aju-phase-2-rollout-updated-migration-recommendations/4656414).
31+
32+ - **Finding joints**: Use `:FindFirstChildWhichIsA("AnimationConstraint")`
33+ instead of `:FindFirstChildOfClass("Motor6D")`. For code that must support
34+ both old and new rigs, check for AnimationConstraint first, then fall back
35+ to Motor6D.
36+ - **C0, C1, Part0, Part1**: These properties exist on AnimationConstraint as
37+ **read-only** aliases for backwards compatibility. They map to
38+ `Attachment0.CFrame`, `Attachment1.CFrame`, `Attachment0.Parent`, and
39+ `Attachment1.Parent` respectively. Do not attempt to write to them.
40+ - **Do not modify RigAttachment.CFrame directly** — this disrupts animation
41+ retargeting and causes performance issues.
42+ - **Transform**: Works identically to `Class.Motor6D.Transform` — the
43+ `Class.Animator` writes to it each frame. Layer procedural animations by
44+ multiplying into `Transform` during `Class.RunService.PreSimulation`, which
45+ stacks with active animation tracks without breaking retargeting.
46+ - **IsKinematic**: When `true` (default), behavior is equivalent to Motor6D.
47+ Set to `false` to enable force-based physical simulation.
48+ - **Type checks**: `animConstraint:IsA("Motor6D")` returns `false`. Update any
49+ `IsA("Motor6D")` guards to also accept `"AnimationConstraint"`.
50+ - **Server replication**: Instead of setting C0 on the server, use client-side
51+ animation evaluation and synchronize data through custom Attributes or
52+ `Class.UnreliableRemoteEvent`.
1453
15- For backwards compatibility with `Class.Motor6D`, `AnimationConstraint`
16- exposes read-only `C0`, `C1`, `Part0`, and `Part1` properties to help adopt
17- the `Class.StarterPlayer.AvatarJointUpgrade|AvatarJointUpgrade`.
54+ ##### Example: Procedural neck rotation
55+
56+ ```lua
57+ -- Before (Motor6D): writing to C0 directly
58+ local originalC0 = neck.C0
59+ RunService.RenderStepped:Connect(function()
60+ neck.C0 = originalC0 * computeNeckRotation()
61+ end)
62+
63+ -- After (AnimationConstraint): multiplying into Transform during PreSimulation
64+ RunService.PreSimulation:Connect(function()
65+ if not animator.EvaluationThrottled then
66+ neck.Transform = computeNeckRotation() * neck.Transform
67+ end
68+ end)
69+ ```
70+
71+ #### Description
72+
73+ An `AnimationConstraint` constrains its `Class.Attachment|Attachments` so that
74+ they're offset by `Class.AnimationConstraint.Transform|Transform`. When
75+ `Class.AnimationConstraint.IsKinematic|IsKinematic` is `true`, the parts
76+ follow the transform perfectly (identical to Motor6D behavior). When `false`,
77+ the constraint applies forces and torques limited by
78+ `Class.AnimationConstraint.MaxForce|MaxForce` and
79+ `Class.AnimationConstraint.MaxTorque|MaxTorque`, enabling physically simulated
80+ character movement.
1881code_samples : []
1982inherits :
2083 - Constraint
0 commit comments