I got stuck and I want to know how to set C0 to the world space angle for CFrame.Angles(MouseProperties.Y,0,0). Currently, it’s relative to the UpperTorso.
So the following example assumes that the CFrame representing the Mouse is world space.
-- this would be world space in this case
local mouseCFrame = CFrame.new(humanoidRootPart.Position, mouseWorldPosition)
-- put it in localspace with the RightShoulder
local shoulderSpaceMouseCFrame = RightShoulder.Part0.CFrame:toObjectSpace(mouseCFrame)
-- remove any position from the shoulderSpaceMouseCFrame to make it a rotation only CFrame
shoulderSpaceMouseCFrame = shoulderSpaceMouseCFrame - shoulderSpaceMouseCFrame.p
-- apply it to the shoulder
rightShoulder.C0 = CFrame.new(1, 0.5, 0) * shoulderSpaceMouseCFrame
Thanks for helping but when I tried this method, I’m still having issues.
I managed to solve this using Part0(UpperTorso)'s Orientation property.
Then I subtracted the world orientation of UpperTorso from the angle.