Why isn't the pulley staying on the cable?
I have a script in a button that the player walks on below.
05 | script.Parent.Touched:connect( function (hit) |
06 | if hit and hit.Parent and hit.Parent:FindFirstChild( "Humanoid" ).Health > 0 then |
08 | larm = char:FindFirstChild( "Left Arm" ) |
09 | rarm = char:FindFirstChild( "Right Arm" ) |
11 | local pulleyStorage = game.ServerStorage:WaitForChild( "Pulley" ) |
13 | local pulley = pulleyStorage:Clone() |
14 | pulley.Parent = game.Workspace |
18 | char:MoveTo(pulley.Part 1. Position - Vector 3. new( 0 , 4 , 0 )) |
20 | local weld = Instance.new( "Weld" ) |
22 | weld.Part 1 = pulley.LArm |
25 | weld.Parent = pulley.LArm |
27 | local weld = Instance.new( "Weld" ) |
29 | weld.Part 1 = pulley.RArm |
32 | weld.Parent = pulley.RArm |
34 | pulley.PrimaryPart.CFrame = CFrame.new(- 190.189835 , 50.8000755 , 196.333801 , 0.866025269 , 0 , 0.500000238 , 0 , 1 , 0 , - 0.500000238 , 0 , 0.866025269 ) |
38 | for i, v in pairs (pulley:GetChildren()) do |
39 | if (v:IsA( "BasePart" )) then |
Basically what the script does, is check when the player steps on the button, clones a pulley into workspace and anchors that pulley so the cable goes through the pulley, welds the player's arms to the pulley, and then unanchors the pulley so that the pulley should go down the cable.
The problem is that when the pulley is unanchored, it simple falls right through the cable instead of suspending the character in the air. There is a two second wait I added so you can see this. I also don't understand why the player's arms don't go up, I thought they were free moving joints...
Here is a gif to help better understand the problem. Notice the player is welded and suspended and the cable goes through the pulley, and then the pulley falls through the cable when its unanchored.
https://gyazo.com/703e77c20fe74f982eb392d2dfebb0be
I don't know if its a problem with my script, or just a physics thing. Any helpful information for fixing my problem, or another way of doing this would be appreciated.