Why is part freezing in place once it gets welded to the player's lower leg or foot?
I have been making a game that requires players to wear a full body suit that gets welded to their body. I made a script & everything works fine until I get to any of the parts that are meant to be welded to the players lower legs, whenever one of them gets welded it just freezes on the players leg & stops them from moving.
I used the same script on every part, the only difference is the target parts so I don't know why these ones aren't working.
Here is the code:
01 | script.Parent.Touched:Connect( function (hit) |
02 | humanoid = hit.Parent:findFirstChild( "Humanoid" ) |
04 | if script.Parent:FindFirstChild( "weld" ) = = nil then |
05 | rightLowerLeg = hit.Parent.RightLowerLeg |
06 | script.Parent.CFrame = rightLowerLeg.CFrame * CFrame.new( 0 , - 0.3155 , 0 ) |
07 | weld = Instance.new( "Weld" ) |
08 | weld.Part 0 = rightLowerLeg |
09 | weld.C 0 = rightLowerLeg.CFrame:Inverse() |
10 | weld.Part 1 = script.Parent |
11 | weld.C 1 = script.Parent.CFrame:Inverse() |
12 | weld.Parent = script.Parent |
13 | weld.Parent.Anchored = false |
I have also tried welding them to the player's foot but it still does the same thing.
I have made sure that it isn't anchored before AND after the script has run.