Constraints problem on character. Have any idea how to fix it?
Asked by
6 years ago Edited 6 years ago
I have made a Ragdoll script, which creates attachments and "Ball in socket" constrains between the character's limbs and torso. When the character dies, all of its Welds breaks except the constrains, turning it into a ragdoll
The problem is that It only works in studio mode. When I tested It online, the character limbs breaks appart just like a normal death. Do anyone know how to fix this?
Also, I tried using that GUI which displays script errors in-game, and nothing pops out
In any case, heres the part of my script
01 | function joint(part 1 ,part 2 ,pos 1 ,pos 2 ,stable) |
02 | local attach 0 = Instance.new( "Attachment" ,part 1 ) |
03 | attach 0. Position = pos 1 |
04 | local attach 1 = Instance.new( "Attachment" ,part 2 ) |
05 | attach 1. Position = pos 2 |
06 | local socket = Instance.new( "BallSocketConstraint" ,part 1 ) |
07 | socket.Attachment 0 = attach 0 |
08 | socket.Attachment 1 = attach 1 |
11 | socket.LimitsEnabled = true |
13 | socket.TwistLimitsEnabled = true |
14 | socket.TwistLowerAngle = 0 |
15 | socket.TwistUpperAngle = 0 |
18 | local tab = { socket,attach 0 ,attach 1 } |
23 | joint(torso,rArm,Vector 3. new( 1.5 , 0.5 , 0 ),Vector 3. new( 0 , 0.5 , 0 ), false ), |
24 | joint(torso,lArm,Vector 3. new(- 1.5 , 0.5 , 0 ),Vector 3. new( 0 , 0.5 , 0 ), false ), |
25 | joint(torso,rLeg,Vector 3. new( 0.5 ,- 1 , 0 ),Vector 3. new( 0 , 1 , 0 ), false ), |
26 | joint(torso,lLeg,Vector 3. new(- 0.5 ,- 1 , 0 ),Vector 3. new( 0 , 1 , 0 ), false ), |
27 | joint(torso,fHead,Vector 3. new( 0 , 1 , 0 ),Vector 3. new( 0 ,- 0.5 , 0 ), false ) |