I have this welding script which works really great when I stand still and I'm not moving around, completely still.

But if I'm walking around while the module gets called the position of the thing I'm welding to the player's torso get all weird, the position is really random and can really vary how far away from the player it teleports or whatever it now does.

It doesn't guarantee the position I want all times, only when I'm standing still, 0 movement.

This is my module script:

function Global.WeldToCharacter(Player, Model)
	for i,v in pairs(Model:GetChildren()) do
		local Weld = Instance.new("Weld")
		Weld.Parent = Model.PrimaryPart
		
		Weld.C0 = (Player.Character:FindFirstChild("UpperTorso") or Player.Character:FindFirstChild("Torso")).CFrame - Vector3.new(0, 4, 0)
		Weld.C1 = CFrame.Angles(0, math.rad(90), 0)
		
		Weld.Part0 = Model.PrimaryPart
		Weld.Part1 = (Player.Character:FindFirstChild("UpperTorso") or Player.Character:FindFirstChild("Torso"))
	end
end

2 comments

0

use WeldConstraints

0

use WeldConstraints