Welding Model to Character Problem

I am having this problem with adding this katana sheathe to my character
I think I have figured out most of it but I am struggling with using CFrame to set it in the right position

Basically how do I set the katana Sheathe in the right position?

image

Thanks

1 Like

You could try somehow offsetting the weld’s C0 property. It’s a CFrame offset. You might want to look on how you’d calculate that but there’s a lot of ways you could use.

I like using weldconstraint over this, but if you were to change into that. Just cframe the sheathe to the hrp and position it to the right position. Make sure the sheathe is massless and just do part0 to the hrp and part1 to the sheathe.

Thanks! I figured it out, I didnt even know the existence off the c0 and c1 offsets lol

1 Like

The multiplication equation at the end will align the two CFrames perfectly. Just copy the following code and try it.

local rs = game:GetService("ReplicatedStorage")
local soundevent = rs.PlayerEvents.StartingScriptEvent

soundevent.OnServerEvent:Connect(function(plr)
	local char = plr.Character
	local charWeld = char.LowerTorso
	local sheathe = rs.Sheathe
	local weld = Instance.new("Weld")
	local clone = sheathe:Clone()
	clone.Parent = char
	weld.Parent = clone
	weld.Part0 = Clone.Parts.WeldPart
	weld.Part1 = charWeld
	local weldPart = clone.Parts.WeldPart
	weld.Part0.CFrame * weld.C0 = weld.Part1.CFrame * weld.C1
end)

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