Trying to weld tool to two hands

I’m trying to make boxing gloves tool and weld left glove to left hand and right glove to right hand but everytime i’m trying to do this gloves aren’t welded to the hands.

ServerScript:

local equipEvent  = game.ReplicatedStorage.Remote:WaitForChild("BoxingGloves")

equipEvent.OnServerEvent:Connect(function(player,tool) 

if tool:IsDescendantOf(game.Workspace) then
		local rbg = tool.RBG
		local lbg = tool.LBG
		local Char = player.Character or player.CharacterAdded:Wait()

		local rweld = Instance.new("WeldConstraint")
		rweld.Part0 = Char.RightHand
		rweld.Part1 = rbg
		rbg.Position = Char.RightHand.Position

		local lweld = Instance.new("WeldConstraint")
		lweld.Part0 = Char.LeftHand
		lweld.Part1 = lbg
		lbg.Position = Char.LeftHand.Position
	end
end)

LocalScript:

local tool = script.Parent
local equipEvent = game.ReplicatedStorage.Remote:WaitForChild("BoxingGloves")

tool.Equipped:Connect(function()
	equipEvent:FireServer(tool) 
end)

There aren’t any errors in the output and this is the result:
image

Make sure to position them on the hands before you weld them. That way it will weld them when they’re on the hands, and not off.

1 Like

image
still not working. They aren’t even welded idk why

The problem is that you’re relying on the automatic offset computation of WeldConstraint to kick in when you want it to, when in reality it’s deferred to the next physics simulation step.

You should try using RigidConstraints instead:

  • Add an Attachment object to each glove.
  • Create a RigidConstraint attaching the LBG’s attachment to the LeftGripAttachment in the player’s LeftHand.
  • Create a RigidConstraint attaching the RBG’s attachment to the RightGripAttachment in the player’s RightHand.
2 Likes

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