How do I change the CFrame/Position of a part relative to a characters arm?

How do I make positioning or moving a CFrame relative to a part? In my case, I am trying to move a welded part to the player’s left arm -.5 studs(relative to their arm’s position because of walking anims etc)

If you are standing entirely still, it works perfectly. Welds to the player at the wrist, stays attached at the right spot, good job :white_check_mark:
But if the player is moving, the arms sway and cause the -.5s to just go down, not down the arm.

game.Players.LocalPlayer.Backpack.TransClicker.Equipped:Connect(function()
	local part = game.ReplicatedStorage.BRICK:Clone()  
	part.CanCollide = false 
	part.Massless = true



	local weldConstraint = Instance.new("WeldConstraint")
	weldConstraint.Part0 = part
	weldConstraint.Part1 = game.Players.LocalPlayer.Character["Left Arm"]
	weldConstraint.Parent = part
	part.CFrame = game.Players.LocalPlayer.Character["Left Arm"].CFrame

	part.Parent = game.Players.LocalPlayer.Character
	game.Players.LocalPlayer.Character.TransClicker.Unequipped:Connect(function()
		part:Destroy()
	end)
end)

this is the code (ignore the mess and absence of variables, it was just to test the weld)

You gotta do some math,

Local leftArm = game.Players.LocalPlayer.Character["Left Arm"]
local NewConstraint = Instance.new("WeldConstraint")

NewConstraint.Position = (leftArm.CFrame * CFrame.new(0,-0.05,0)).Position -- the thing you probably need

Might be wrong because I’m not in Roblox Studio to test the stuff

1 Like

I appreciate the help. Fixed the problem perfectly

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