Motor6D
The joints of a Roblox-style rig. Join two parts and the second follows the first; turn it and it swings about the joint, ready to key.
A Motor6D drives its Part1 by Roblox's formula, Part1.CFrame = Part0.CFrame * C0 * Transform * C1:Inverse(), solved every frame from the start of each rig out to the tips, in Edit and Play. Transform is the pose: keys, rig clips, wires and scripts animate it. Move or turn Part1 by hand and it stays where you put it. To make one, select two parts, right-click in the Explorer and choose Join with Motor6D: nothing moves.
Example
local studio = Root.Sandbox.DataModels.Studio
local function part(name, x)
local p = Instance.new("Part")
p.Name = name
p.Size = Vector3.new(2, 1, 1)
p.CFrame = CFrame.new(x, 5, 0)
p.Parent = studio
return p
end
local b = part("ChainB", 4)
local c = part("ChainC", 9)
local jb = Instance.new("Motor6D")
jb.Name = "JointB"
jb.Part0 = b
jb.Part1 = c
jb.C0 = CFrame.new(1.5, 0, 0) * CFrame.Angles(0, 0, math.rad(10))
jb.C1 = CFrame.new(-1.5, 0, 0)
jb.Parent = studio
jb.Transform = CFrame.Angles(0, math.rad(45), 0)Properties
Scripts
| Name | Type | Default | Description |
|---|---|---|---|
| Active | boolean | scripts only | Whether the joint drives its Part1 right now. |
Joint
| C0 | CFrame | 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1 | Part of the rig with C1; hold Alt as a viewport drag starts to rewrite C0 instead of posing the part. |
| C1 | CFrame | 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1 | Part of the rig with C0; moving Part1 by hand poses the joint and leaves C0 and C1 as they are. |
| Enabled | boolean | true | The joint is active only when Enabled and both parts are in its own DataModel. |
| Part0 | BasePart | The part Part1 is held to. | |
| Part1 | BasePart | The part the joint drives, placed at Part0.CFrame * C0 * Transform * C1:Inverse(). | |
| C0Position | Vector3 | Properties window only | The old split position part of C0, hidden from Properties. |
| C0Orientation | Vector3 | Properties window only | The old split rotation half of C0, hidden from Properties. |
| C1Position | Vector3 | Properties window only | |
| C1Orientation | Vector3 | Properties window only |
Pose
| Transform | CFrame | 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1 | The pose; scripts and wires animate it. |
| TransformPosition | Vector3 | Properties window only | The old split position part of Transform, hidden from Properties. |
| TransformOrientation | Vector3 | Properties window only | The old split rotation half of Transform, hidden from Properties. |
