So I am building a game which includes a full body suit that gets welded to the player, I have the parts & for testing I have made them weld themselves to the player when the player touches them. But when any of the parts that are meant to be attached to the player's lower leg get welded, the player stops moving. I have also tried welding the part to the players foot instead but the same problem happens

here is the code:

function WeldEnable (x, y, z)
	if Prt1:FindFirstChild("weld") == nil then
		Prt1.CFrame = Prt0.CFrame * CFrame.new(x, y, z)
		weld = Instance.new("Weld")
		weld.Part0 = Prt0
		weld.C0 = Prt0.CFrame:Inverse()
		weld.Part1 = Prt1
		weld.C1 = Prt1.CFrame:Inverse()
		weld.Parent = Prt1
		weld.Parent.Anchored = false
	end
end

if script.Parent:FindFirstChild("weld") == nil then
end
script.Parent.Touched:Connect(function(hit)
	humanoid = hit.Parent:findFirstChild("Humanoid")
	if humanoid then
		
			Prt0 = hit.Parent.LeftLowerLeg
			Prt1 = script.Parent
			WeldEnable(0, -0.0965, 0)
		
	end
end)

4 comments

0

make sure the part's "Cancollide" feature is off........... or false

0

Same with anchored ^

0

I just tried turning off CanCollide & I already made sure that it is not anchored but it still doesn't work, & It only doesn't work for the foot/lower leg

0

I just did some testing & it turns out that it is the part that is freezing, I raised the weld higher & disconnected it & it freezed in place! But I checked the part but it wasn't anchored