Motor6D in Place Issues

Hello!

I’m currently fighting off pulling my hair out over an issue that I thought would be pretty menial but, I’m evidently having an issue with generating a motor6d in place.

I thought it would be exactly like welds in place, where you set the C0 and the C1 to the inverse of each part’s CFrame but, for whatever reason, it ended up doing this?

Here’s the function I’m working with currently:

function module.M6DInPlaceWeld(sendModule, part0, part1)

	local m6D = Instance.new("Motor6D")

	m6D.Part0 = part0
	m6D.Part1 = part1
	
	m6D.C0 = part0.CFrame:Inverse()
	m6D.C1 = part1.CFrame:Inverse()
	
	m6D.Parent = part0
	m6D.Name = part1.Name

	return

end

I have a feeling I just need to offset it in some specific way, but I can’t find what that offset is anywhere. Any help is greatly appreciated.

Why are you using a m6d? If the sword is going to be stuck on your back you can use a weldConstraint

I’m using a motor6d because I’d like to subtly animate that sword while it’s on the players back.

Like this:

It was a cool detail I saw in some games like AC Odyssey and wanted to implement.

If you are animating it you need to use the same C0 and C1 as the one the animation uses or else the bug you are experiencing will happen as it Changes the joint position and the animation CFrame maths.

Use Motor6D:Clone() to ensure the same C0 and C1 as the one you used on the animation.

1 Like

This is exactly why I’m glad devforum exists.

Worked the first time like a charm, I genuinely have no clue why it would never occur to me to just clone the darn thing :man_facepalming:

Thanks for your help!