Welding Lots of Parts to a Character

I was making a shopping game, and I was trying to weld the shopping cart to the HumanoidRootPart.
Although, when ever I welded it in several different ways, it gave me weird walking physics that I did not want in my game.

Weird walking physics: https://gyazo.com/184b6026bd312a6885278315afe6478f

Welding part of code:

local cart = game.ReplicatedStorage.Carts:FindFirstChild(plr.Data.Cart.Cart.Value)
for _,child in pairs(cart:GetDescendants()) do
if child:IsA(“BasePart”) or child:IsA(“WedgePart”) or child:IsA(“MeshPart”) then
local weld = Instance.new(“WeldConstraint”,cart)
weld.Part0 = cart.PrimaryPart
wled.Part1 = child
end
end
local weld = Instance.new(“Motor6D”,cart)
weld.C0 = CFrame.new(plr.Character.HumanoidRootPart.CFrame.lookVector * 7)
weld.Part0 = plr.Character.HumanoidRootPart
weld.Part1 = cart.PrimaryPart
cart.Parent = plr.Character

The Primary part is close to the middle of the shopping cart.

I have tried welding constraints, Motor6D, and both of them combined. Also welding to the Upper and Lower Torso (They all gave me very similar results.
I do not want to use a script that repositions the cart fast. I just want the cart to be welded to the character and allow for the character to rotate and walk normally.

Turn the cancollide of the shopping cart off.

That’s what I was using, and it still didn’t work.

1 Like

Maybe weld it to their head instead? Or you could create a part that welds to the player’s HumRootPart and weld the cart to that.

That’s what the current script is doing. Although, I don’t want to weld it to the head because then it will move with the head too. For example, while the player is idle and the player head rotates, the cart will rotate with it.

Please stop using the parent argument of Instance.new.

As for the weird walking physics you’re encountering, this is primarily due to the mass of the shopping cart itself. You can nullify this by adding in a line to your code that will set Massless to false on all the parts. Give that a shot and it should work.

1 Like

Thanks! Setting all the parts to massless worked! Also, thanks for the Instance.new parent article, I will do the other way from now on.