CFrame not working properly?

Hi there!

Im making a crate pickup system, but for some reason the CFrame is doing weird. What am i doing wrong?

image

image

Thanks!

Look’s like it’s doing what you programmed it to do. Just play around with the weld CFrame until you get it to look how you want.
Instead of: image
Try: image 3,0,0)

Already tried that with all the vectors, this is the result:

image

Try: […]Cframe.new(3,0,2)
Anyways it’s really just playing around with it. I usually add a rootpart the same size as one of my character’s limbs that I want it to weld too so I could avoid the hassle of doing all this.

C0 and C1 represents the displacement that each part will have. In this case the HumanoidRootPart does not require any displacement so it should only displace the crate.Center

workspace.Crate.ClickDetector.MouseClick:Connect(function (plr)
	local char = plr.Character
	local crate = workspace.Crate:Clone()
	
	for i, v in pairs(crate:GetChildren()) do
		if v:IsA("LocalScript") or v:IsA("ClickDetector") then
			v:Destroy()
		end
	end	
	
	local weld = Instance.new("Weld")
	crate.Parent = char
	
	weld.Part0 = char.HumanoidRootPart
	weld.Part1 = crate.Center
	weld.C0 = CFrame.new()
	weld.C1 = CFrame.new(0,0,3)
	weld.Parent = char.UpperTorso
	print(weld.Name)
end)
1 Like