Attempt to make (R6) arm Motor6Ds' C0 relative to HumanoidRootPart

I have been trying to make procedural animation by making (R6) arms follow where the character faces, but their joints must be relative to HumanoidRootPart instead of Torso. Here’s what it is supposed to look like (from Headstackk’s tweet)


There have been very few threads about it


Applying dthecoolest’s method with my edits~

--RENDER
local dir = torso.CFrame:ToObjectSpace(root.CFrame).LookVector
local _, _, z = rootJoint.Transform:ToOrientation() --Get the Z axis rotation, which is the animation angle rotating the torso left or right (ex. clockwise/anticlockwise when viewing character from above)
rightShoulder.C0 = CFrame.new(rc0.p) --[[* CFrame.Angles(0, -z, 0)]] * CFrame.Angles(math.asin(dir.Y), 1.55, 0) * CFrame.Angles(0, -math.asin(dir.X), 0) --CFrame.Angles(0, 0, math.asin(dir.Y))
leftShoulder.C0 = CFrame.new(lc0.p) --[[* CFrame.Angles(0, -z, 0)]] * CFrame.Angles(math.asin(dir.Y), -1.55, 0) * CFrame.Angles(0, -math.asin(dir.X), 0) --CFrame.Angles(0, 0, -math.asin(dir.Y))
if MainControl then
    MainControl.C0 = not IsFirstPerson() and (CFrame.new(OriginalC0.p) --[[* CFrame.Angles(0, -z, 0)]] * CFrame.Angles(math.asin(dir.Y), 0, 0)  * CFrame.Angles(0, -math.asin(dir.X), 0)) or OriginalC0
end

(simplified version)

---RENDER
local dir = torso.CFrame:ToObjectSpace(root.CFrame).LookVector
rightShoulder.C0 = CFrame.new(rc0.p, rc0.p + dir) * CFrame.Angles(0, math.pi/2, 0)
leftShoulder.C0 = CFrame.new(lc0.p, lc0.p + dir) * CFrame.Angles(0, -math.pi/2, 0)
if MainControl then
    MainControl.C0 = not IsFirstPerson() and CFrame.new(OriginalC0.p, OriginalC0.p + dir) or OriginalC0
end

(Note: “rc0” and “lc0” are original arms’ c0)

~I will get this result, the arms are out of sync. I am not sure about the weapon model. However, according to Headstackk’s advice, it should not be sensitively rotated left/right like Normal rig, which is obviously shown in the video below.


Until now, the solution is not yet to come. But if you have any answers, don’t hesitate to reply to this thread. Thanks.

3 Likes

Bumping this thread. It’s been almost a week and still no words.