Why does Motor6D reposition body parts?

I have a custom R6 rig character, but every time I put Motor6D’s in it moves the body parts itself. It ends up messing up my character and moves the parts in ridiculous places. Why does this happen, and how do I make it so the body parts stay where I originally positioned them?

1 Like

Are you placing them in manually or with a script?

Manually, and when this happens it will move the body part somewhere I didnt originally position the body part. Should this be scripted?

That’s because the properties for the offsets are hidden in the properties window. You need to do this via a script to do it properly.

Part0 is the part to attach to and Part1 is the part that is the parent of that ligament

Yea make sure to set the cframe to the parents cframe with an offset :wink:

That will not help him, he is already doing that, but those do not determine the offsets.

1 Like

Is there anything I need to look at when scripting this, or does setting the Part0 and 1 work fine when doing this?

The wiki is your friend: Motor6D | Documentation - Roblox Creator Hub
You will want to look at the C0 and C1 properties. But you only really need to deal with the C0 property when creating your offsets because C1 is derived from C0.

1 Like

So what would I do with C0? Im trying not to ask for code and do it myself but I dont really understand what the wiki is trying to tell me. Maybe an explanation on the math or how this would work?

Here is an example where I am attaching a motor6d for the head/torso:

local character = game.Players.LocalPlayer.Character
local torso = character:FindFirstChild("UpperTorso") or character:FindFirstChild("Torso")

local motor6d = Instance.new("Motor6D")
motor6d.Parent = torso
motor6d.Part1 = character.Head
motor6d.Part0 = torso
local offset = CFrame.new(0,2,0)
motor6d.C0 = motor6d.Part0.CFrame:inverse() * motor6d.Part1.CFrame * offset

they share the same position if my offset was zero but i set the offset to (0,2,0) so my head is now two studs above the torso

6 Likes

Don’t set the parent before you set the other properties.

1 Like

This is perfect I understand a lot better now. Thank you!

So I’d assume I should put this into the StarterCharacterScripts then and Ill be good?

I would do this with a regular script, then while the game is running, copy the entire character, stop the game, and then paste it back in to where you stored the character originally.

Well everything worked, my last issue is the orientation.

Orientation should not be a problem because you are working with CFrames.