Today I come to you seeking assistance. I’m trying to solve a pretty simple issue, I just don’t know what exactly the code would be to properly execute this.
I need to take the RightShoulder Motor6D of a humanoid and move it in relation to the player’s HumanoidRootPart. So if they’re firing a gun for example, their RightShoulder will always move ‘backwards’ since the C1 or C0 is being set in relation to the root. Currently I can just do something like:
To accomplish this you’d need to make some extra configurations. It would take some scripting to handle this. The Motor6D needs to have a function to change it. The script/configuration you would have to use would need to connect each part of the Motor6D in order for it to function correctly.
Stumbled on this old post, offering a solution for future searches.
The question involves understanding Object Space vs World Space. You want to translate an offset of -1 in the Z-axis of object space into a world space CFrame.
local offset = CFrame.new(0, 0, -1) -- relative to part in object space
rightShoulder.C1 = rightShoulder.C1.CFrame:toWorldSpace(offset) -- translate to world space