Need help on how you can rotate a Motor6D to a part in a script

Hello, I’m trying to figure out how Motor6D works to help me understand welds and joints. I’ve been stuck at a point where I can’t rotate the C0 of the Motor6D of a certain part in a script.

I don’t think there is any issues, there is no errors when I run the script. It’s pretty much a lack of knowledge because I don’t really know how joints and all work.

I tried a lot of things related to CFrames but none of them worked. There is my script bellow showing the script that I tried so far. Note that I have no idea if I’m even using the right formula about CFrame

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

Script example :

local Dummy = game.Workspace:WaitForChild("Dummy")
local Part = game.Workspace:WaitForChild("Target")

local Root = Dummy:WaitForChild("HumanoidRootPart")
local Arm = Dummy:WaitForChild("RightUpperArm"):WaitForChild("RightShoulder")

wait(3)

local ArmDirection = Arm.C0:ToObjectSpace(Part.CFrame)

Arm.C0 = CFrame.new(0,0,0) * CFrame.Angles(ArmDirection.X,ArmDirection.Y,0)

Here is a small and easy representation of what I’m trying to do, the right arm should be looking towards the red highlighted part :

Here is the example of what it should achieve in the script, also note that I did this in an animation instead of playing with the Motor6D :

1 Like

it’s rlly tricky but i remember that even if C0 or C1 had their info of the property contained, it will still print a different number as they are vector3 since you can’t get it’s info like Position or Orientation, apparently CFrame for Motor6D’s are stored in these 2 types Part0 and Part1 which is what C0 and C1 contains.

haven’t scripted smth related to Motor6D in ages so that’s all my knowledge.

Thank you, even if it’s been ages I still got some infos that’s all I need for the moment