Problem with attaching model to character

Hey my friend has animated a katana with sheath for a fighting class and I’m trying to attach it to the character with Motor6Ds. However something goes very wrong.

Expected result:


Actual result:
katana man

The code below is me copying the C0 and C1 from the Motor6Ds in the animated dummy and remaking them into the player’s character… Is this not the right way to weld? Can I do something do fix this? Or do I need a completely different method??

    local set = rip.Models.DaishoSet:Clone()
	set.Parent = character
	
	local weldS1K = Instance.new("Motor6D")
	weldS1K.C0 = CFrame.new(-1.223, -1.175, 1.338); weldS1K.C0 = CFrame.Angles(0, -94, -17); 
	weldS1K.C1 = CFrame.new(0, 0, 0); weldS1K.C1 = CFrame.Angles(0, 0, 0)
	weldS1K.Part0 = character.Torso
	weldS1K.Part1 = set.Katana.Sheath1K
	weldS1K.Parent = character["Torso"]
	
	local weldS1W = Instance.new("Motor6D")
	weldS1W.C0 = CFrame.new(-1.067, -0.845, 0.79); weldS1W.C0 = CFrame.Angles(-0, -93, -4); 
	weldS1W.C1 = CFrame.new(0, 0, 0); weldS1W.C1 = CFrame.Angles(0, 0, 0)
	weldS1W.Part0 = character.Torso
	weldS1W.Part1 = set.Wakizashi.Sheath1W
	weldS1W.Parent = character["Torso"]
	
	local katana = rip.Models.Katana:Clone()
	katana.Parent = character
	
	local weldK = Instance.new("Motor6D")
	weldK.C0 = CFrame.new(-0.012, -0.965, 0.087); weldK.C0 = CFrame.Angles(0, 90, -0); 
	weldK.C1 = CFrame.new(0, 0, 0); weldK.C1 = CFrame.Angles(0, 0, 0)
	weldK.Part0 = character["Right Arm"]
	weldK.Part1 = katana.HandleK
	weldK.Parent = character["Right Arm"]
2 Likes

im sure theres probably a better, actual way to do it with Motor6D’s but incase you want a quick fix to do the same thing couldnt you just attach the sheath with a WeldConstraint? from there all you would need to animate is the sword no? it would also be more rigid to the waist i guess

1 Like

Thanks for the reply, it just doesn’t work though? May be my bad understanding of WeldConstraints but basically when I try to set the handle CFrame to the arm’s/torso’s after welding, models don’t appear.

1 Like

try before welding, im pretty sure parts cant move relative to the welded part once welded.

1 Like

I just tried that too, same thing. Though one more thing, if this method worked, would the animations play? The sword and sheath move around.

1 Like

you may have to do RunService.Stepped:Wait() so you move it before physics are calculated, else it might move around before its actually welded

1 Like

oh, if the sheath moves too, then no, sorry, i was under the assumption the sheath wouldnt move relative to the waist

2 Likes

I see. Thanks a lot for your time though.

1 Like

This is solved! Problem was that the angles weren’t setting.

changing from

weldK.C0 = CFrame.new(-0.012, -0.965, 0.087); weldK.C0 = CFrame.Angles(0, 90, -0); 

to

weldK.C0 = CFrame.new(0, -0.938, 0) * CFrame.Angles(0,math.rad(90),math.rad(0))

fixes the issue.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.