Arm c0 not compensating for torso rotation

local dir = torso.CFrame:ToObjectSpace(mouse.Origin).LookVector.Unit
			rightShoulder.C0 = CFrame.new(1, 0.5, 0) * CFrame.Angles(math.asin(dir.Y), 0, 0) * CFrame.Angles(0, math.pi / 2, 0)
			leftShoulder.C0 = CFrame.new(-1, 0.5, 0) * CFrame.Angles(math.asin(dir.Y), 0, 0) * CFrame.Angles(0, -math.pi / 2, 0)
1 Like

You can add another angle to compensate for the torso rotation using :ToOrientation().

are you sure this script isn’t r15 only since it broke the arms further
image

hey everyone i actually figured out this problem on my own

local rootLook = root.CFrame.LookVector
local torsoLook = torso.CFrame.LookVector
			
local angleFix = math.acos(rootLook:Dot(torsoLook))

rightShoulder.C0 = CFrame.new(1, 0.5, 0) * CFrame.Angles(0, angleFix, 0) * CFrame.Angles(math.asin(dir.Y), 0, 0) * CFrame.Angles(0, -angleFix, 0) * CFrame.Angles(0, math.pi / 2, 0)
local offset = torso.CFrame * rightShoulder.C0 * (CFrame.new(-0.5, 0.5, 0) * CFrame.Angles(0, math.pi / 2, 0)):Inverse() * CFrame.new(-3, 0, 0) * (CFrame.new(0.5, 0.5, 0))
leftShoulder.C0 = torso.CFrame:ToObjectSpace(offset) * CFrame.Angles(0, -math.pi / 2, 0)

4 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.