My ragdoll floats away whenever platformstand/sit is disabled, when enabled the ragdoll’s limbs clip through the floor but does not fly away. I need it disabled so it does not clip, how do I fix this, or is there any alternatives? The main problem is that, it keeps reverting the properties.
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local humanoid = hit.Parent.Humanoid
if not humanoid:FindFirstChild("Ragdolled") then
local character = hit.Parent
local ragdolledVal = Instance.new("BoolValue")
ragdolledVal.Name = "Ragdolled"
ragdolledVal.Parent = humanoid
humanoid.AutoRotate = false
character.HumanoidRootPart.Anchored = false
humanoid.PlatformStand = false
humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp,false)
--humanoid.
humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,true)
humanoid:ChangeState(Enum.HumanoidStateType.Ragdoll)
--humanoid:SetStateEnabled(Enum.HumanoidStateType.Physics,true)
humanoid:SetStateEnabled(Enum.HumanoidStateType.Running,false)
--humanoid:SetStateEnabled(Enum.HumanoidStateType.None,true)
character.HumanoidRootPart:SetNetworkOwner(nil)
--humanoid:SetNetworkOwner(nil)
character:WaitForChild("Animate").Disabled = true
for i, v in pairs(character:GetDescendants()) do
if v:IsA("Motor6D") and v.Parent.Name ~= "HumanoidRootPart" then
local attach0 = Instance.new("Attachment")
attach0.CFrame = v.C0
attach0.Parent = v.Part0
local attach1 = Instance.new("Attachment")
attach1.CFrame = v.C1
attach1.Parent = v.Part1
local BallSocketConstraint = Instance.new("BallSocketConstraint")
BallSocketConstraint.Parent = v.Parent
BallSocketConstraint.Name = v.Name
BallSocketConstraint.Attachment0 = attach0
BallSocketConstraint.Attachment1 = attach1
BallSocketConstraint.LimitsEnabled = true
BallSocketConstraint.TwistLimitsEnabled = true
BallSocketConstraint.Enabled = true
v:Destroy()
elseif v:IsA("MeshPart") or v:IsA("BasePart") or v:IsA("CharacterMesh") and v.Name ~= "HumanoidRootPart" then
v.CanCollide = true
--local collider = Instance.new("Part")
--collider.Transparency = 1
--collider.Size = v.Size
--collider.CFrame = v.CFrame
--collider.Name = "Collider"
--collider.CanCollide = true
--collider.Parent = character
--local weld = Instance.new("Weld")
--weld.Parent = v
--weld.Part0 = v
--weld.Part1 = collider
end
humanoid.AutoRotate = false
character.HumanoidRootPart:SetNetworkOwner(nil)
character.HumanoidRootPart.CanCollide = false
--character.HumanoidRootPart.Parent = nil
--humanoid:SetNetworkOwner(nil)
--character.HumanoidRootPart.Anchored = true
end
end
end
end)
So my main question is, how do I prevent the ragdoll from flying away, while being able to keep platform stand and that disabled? While ragdoll being able to move around still
I got this problem once, and to fix it you need to set HumanoidRootPart network ownership to nil, so what happens is you set the state to ragdoll, then a player comes near and the network ownership becomes player, this causes the state to change which makes the humanoid float.
I was struggling with this myself earlier today. I inserted a body velocity into the HumanoidRootPart, and I set the velocity to Vector3.new(0, -1000, 0) and that worked for me.