So recently, I was coding a ragdoll system for a game. I’m extremely confused mainly because of roblox’s hidden corescripts for humanoid I don’t get to see. I noticed whenever I jump before ragdolling that it for some odd reason does not set platformstand to the value I want. Another weird issue is that it sets the cancollide of all the limbs to false if I jump before. Does anyone know
what is happening?
here’s a video of the issue as well:
here’s my code:
local LeftLeg = script.Parent:WaitForChild("Left Leg")
local LeftArm = script.Parent:WaitForChild("Left Arm")
local RightArm = script.Parent:WaitForChild("Right Arm")
local RightLeg = script.Parent:WaitForChild("Right Leg")
local Head = script.Parent:WaitForChild("Head")
local Humanoid = script.Parent:FindFirstChildOfClass("Humanoid")
local Character = script.Parent
local function SetRagdoll(Value)
Humanoid.AutoRotate = not Value
Humanoid.PlatformStand = Value
for _,Joint in pairs(Character:GetDescendants()) do
if Joint:IsA("Motor6D") and Joint.Parent.Parent == Character then
Joint.Enabled = not Value
end
end
Character.Data.Ragdoll.Value = Value
task.wait(0.05)
LeftArm.CanCollide = Value
LeftLeg.CanCollide = Value
RightArm.CanCollide = Value
RightLeg.CanCollide = Value
if not Value then
Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
else
Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, true)
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, true)
end
end```