Hello!, i have an issue where i ragdoll player 1’s left arm, and player 2’s right arm, but when i do that player 1(leader) cannot walk anymore to guide player 2. and during that time it makes them slide too.
heres the code:
local Motors = {
Motor1 = mainchar:FindFirstChild("Torso"):FindFirstChild("Left Shoulder"),
Motor2 = targetchar:FindFirstChild("Torso"):FindFirstChild("Right Shoulder")
}
Motors.Motor1.Enabled = false
Motors.Motor2.Enabled = false
local function createBallSocket(motor)
local socket = Instance.new("BallSocketConstraint", motor.Parent)
local attach1 = Instance.new("Attachment", motor.Part0)
local attach2 = Instance.new("Attachment", motor.Part1)
socket.Attachment0 = attach1
socket.Attachment1 = attach2
attach1.CFrame = motor.C0
attach2.CFrame = motor.C1
socket.LimitsEnabled = true
socket.TwistLimitsEnabled = true
socket.UpperAngle = 90
socket.Restitution = 0.5
return socket
end
coroutine.wrap(createBallSocket)(Motors.Motor1)
coroutine.wrap(createBallSocket)(Motors.Motor2)
local MainCharAttachment = Instance.new("Attachment", mainchar:WaitForChild("Left Arm"))
local TargetCharAttachment = Instance.new("Attachment", targetchar:WaitForChild("Right Arm"))
local HandSocket = Instance.new("BallSocketConstraint", mainchar:WaitForChild("Left Arm"))
HandSocket.Attachment0 = MainCharAttachment
HandSocket.Attachment1 = TargetCharAttachment
HandSocket.LimitsEnabled = true
HandSocket.TwistLimitsEnabled = true
HandSocket.UpperAngle = 45
local noCollide = Instance.new("NoCollisionConstraint", mainchar:WaitForChild("Left Arm"))
noCollide.Part0 = mainchar:WaitForChild("Left Arm")
noCollide.Part1 = targetchar:WaitForChild("Right Arm")
– and, here is a screenshot of my issue:
You need to implement a movement system that decouples Player 1’s movement from the arm constraints. Instead of disabling the Left Shoulder motor entirely, create a controlled ragdoll effect by temporarily replacing it with a BallSocketConstraint that allows limited movement while preserving Player 1’s ability to walk. Also use AlignPosition and AlignOrientation constraints to guide Player 2’s arm while maintaining Player 1’s control over their character.
i did try that too, same stuff. also i already use alignposition and alignorientation for the thing’s main system, but this ragdoll effect is pissing me off to another level.
Motor1 = mainchar:FindFirstChild("Torso"):FindFirstChild("Left Shoulder"),
Motor2 = targetchar:FindFirstChild("Torso"):FindFirstChild("Right Shoulder")
}
Motors.Motor1:Destroy()
Motors.Motor2:Destroy()
local function createBallSocket(part0, part1, c0, c1)
local socket = Instance.new("BallSocketConstraint", part0)
local attach1 = Instance.new("Attachment", part0)
local attach2 = Instance.new("Attachment", part1)
socket.Attachment0 = attach1
socket.Attachment1 = attach2
attach1.CFrame = c0
attach2.CFrame = c1
socket.LimitsEnabled = true
socket.TwistLimitsEnabled = true
socket.UpperAngle = 90
socket.Restitution = 0.2
return socket
end
createBallSocket(
mainchar:FindFirstChild("Torso"),
mainchar:FindFirstChild("Left Arm"),
Motors.Motor1.C0,
Motors.Motor1.C1
)
createBallSocket(
targetchar:FindFirstChild("Torso"),
targetchar:FindFirstChild("Right Arm"),
Motors.Motor2.C0,
Motors.Motor2.C1
)
local MainCharAttachment = Instance.new("Attachment", mainchar:WaitForChild("Left Arm"))
local TargetCharAttachment = Instance.new("Attachment", targetchar:WaitForChild("Right Arm"))
local HandSocket = Instance.new("BallSocketConstraint", mainchar:WaitForChild("Left Arm"))
HandSocket.Attachment0 = MainCharAttachment
HandSocket.Attachment1 = TargetCharAttachment
HandSocket.LimitsEnabled = true
HandSocket.TwistLimitsEnabled = true
HandSocket.UpperAngle = 60
local stopcolliding = Instance.new("NoCollisionConstraint", mainchar:WaitForChild("Left Arm"))
stopcolliding.Part0 = mainchar:WaitForChild("Left Arm")
stopcolliding.Part1 = targetchar:WaitForChild("Right Arm")
mainhum:ChangeState(Enum.HumanoidStateType.GettingUp)
targethum:ChangeState(Enum.HumanoidStateType.GettingUp)```
When you destroy the Left Shoulder motor and replace it with a BallSocketConstraint , it disrupts the natural movement of Player 1, causing the inability to walk and sliding behavior.
-- Define the characters and motors
local mainchar = game.Players.LocalPlayer.Character
local targetchar = -- Define target character here
local mainhum = mainchar:WaitForChild("Humanoid")
local targethum = targetchar:WaitForChild("Humanoid")
local Motors = {
Motor1 = mainchar:FindFirstChild("Torso"):FindFirstChild("Left Shoulder"),
Motor2 = targetchar:FindFirstChild("Torso"):FindFirstChild("Right Shoulder")
}
-- Temporarily disable motors instead of destroying them
Motors.Motor1.Enabled = false
Motors.Motor2.Enabled = false
-- Function to create a controlled ragdoll effect
local function createSoftRagdoll(part0, part1, c0, c1)
local alignPos = Instance.new("AlignPosition", part0)
local alignOri = Instance.new("AlignOrientation", part0)
local attach1 = Instance.new("Attachment", part0)
local attach2 = Instance.new("Attachment", part1)
alignPos.Attachment0 = attach1
alignPos.Attachment1 = attach2
alignOri.Attachment0 = attach1
alignOri.Attachment1 = attach2
attach1.CFrame = c0
attach2.CFrame = c1
-- Configure AlignPosition
alignPos.RigidityEnabled = false
alignPos.MaxForce = 5000
alignPos.Responsiveness = 200
-- Configure AlignOrientation
alignOri.RigidityEnabled = false
alignOri.MaxTorque = 5000
alignOri.Responsiveness = 200
return alignPos, alignOri
end
-- Apply soft ragdoll to Player 1's left arm
local mainAlignPos, mainAlignOri = createSoftRagdoll(
mainchar:FindFirstChild("Torso"),
mainchar:FindFirstChild("Left Arm"),
Motors.Motor1.C0,
Motors.Motor1.C1
)
-- Apply soft ragdoll to Player 2's right arm
local targetAlignPos, targetAlignOri = createSoftRagdoll(
targetchar:FindFirstChild("Torso"),
targetchar:FindFirstChild("Right Arm"),
Motors.Motor2.C0,
Motors.Motor2.C1
)
-- Connect the arms with a BallSocketConstraint
local MainCharAttachment = Instance.new("Attachment", mainchar:WaitForChild("Left Arm"))
local TargetCharAttachment = Instance.new("Attachment", targetchar:WaitForChild("Right Arm"))
local HandSocket = Instance.new("BallSocketConstraint", mainchar:WaitForChild("Left Arm"))
HandSocket.Attachment0 = MainCharAttachment
HandSocket.Attachment1 = TargetCharAttachment
HandSocket.LimitsEnabled = true
HandSocket.TwistLimitsEnabled = true
HandSocket.UpperAngle = 60
-- Prevent collision between the connected arms
local stopColliding = Instance.new("NoCollisionConstraint", mainchar:WaitForChild("Left Arm"))
stopColliding.Part0 = mainchar:WaitForChild("Left Arm")
stopColliding.Part1 = targetchar:WaitForChild("Right Arm")
-- Reset Humanoid states to ensure stability
mainhum:ChangeState(Enum.HumanoidStateType.GettingUp)
targethum:ChangeState(Enum.HumanoidStateType.GettingUp)
local char = script.Parent
local torso = char:WaitForChild("Torso")
local leftarm = char:WaitForChild("Right Arm")
local left = torso:WaitForChild("Right Shoulder")
local socket = Instance.new("BallSocketConstraint", torso)
local att1 = Instance.new("Attachment", torso)
local att2 = Instance.new("Attachment", leftarm)
att1.CFrame = left.C0
att2.CFrame = left.C1
socket.Attachment0 = att1
socket.Attachment1 = att2
left.Enabled = false
i have found a simpler fix, which is really good and clean, though i’ll mark your post as a solution as it can do the trick too, just longer