Hello everybody, I have come across a problem that I just can’t fix. It has to do with my game’s ragdoll mechanic not working properly in the Game Client, but when I do the same exact actions on Studio, the ragdoll works just as expected.
Visual Demonstration:
Client:
Studio:
Here is the ragdoll method:
function RagdollModule:RagDoll(characterModel: Model)
for _, Descendents: Instance in pairs(characterModel:GetDescendants()) do
if Descendents:IsA("Motor6D") and Descendents.Parent.Name ~= "Head" then
local A0, A1 = Instance.new('Attachment'), Instance.new('Attachment')
A0.CFrame = Descendents.C0
A1.CFrame = Descendents.C1
A0.Parent = Descendents.Part0
A1.Parent = Descendents.Part1
local BallSocketConstraint = Instance.new('BallSocketConstraint', Descendents.Parent)
BallSocketConstraint.Attachment0 = A0
BallSocketConstraint.Attachment1 = A1
Descendents.Enabled = false
end
end
if RunService:IsServer() then
local Player = Players:GetPlayerFromCharacter(characterModel)
if Player then
SNet:EmitClientEvent(Player, script.Name, "Ragdoll")
else
characterModel:WaitForChild('Humanoid').RequiresNeck = false
characterModel:WaitForChild('Humanoid'):ChangeState(Enum.HumanoidStateType.Physics)
end
end
end
Here is how it’s used (Yes this is in a server context):
Bv.Velocity = player.Character.HumanoidRootPart.CFrame.LookVector*25 + Vector3.new(0,10,0)
Ragdoll:RagDoll(targetCharacter)
Any help counts!