#Ragdoll Issue
1 messages · Page 1 of 1 (latest)
the main issue is in here (i think):
function ragdoll.Stop(character, player)
character:SetAttribute("Ragdolled", false)
local humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoid then return end
humanoid.PlatformStand = false
humanoid.UseJumpPower = true
humanoid.AutoRotate = true
humanoid.WalkSpeed = 16
humanoid.JumpPower = 50
for _, v in pairs(character:GetDescendants()) do
if v:IsA("BallSocketConstraint") or v:IsA("Attachment") or v:IsA("WeldConstraint") then
v:Destroy()
elseif v:IsA("Motor6D") then
v.Enabled = true
end
end
for _, part in character:GetChildren() do
if part:IsA("BasePart") and part.Name:find(COLLIDER_NAME) then
part:Destroy()
end
end
for _, part in character:GetDescendants() do
if part:IsA("BasePart") then
part.AssemblyLinearVelocity = Vector3.zero
part.AssemblyAngularVelocity = Vector3.zero
end
end
humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
--humanoid:SetStateEnabled(Enum.HumanoidStateType.Freefall, true)
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
end
owahhh finally you came here
i can see tons of issues
youre enabling Motor6Ds while still in ragdoll state which can cause conflicts
setting states and changing them immediately doesnt give the humanoid time to process
you skip the RootJoint in ragdoll start but dont handle it properly in stop
firstly fix the stop function
function ragdoll.Stop(character, player)
character:SetAttribute("Ragdolled", false)
local humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoid then return end
for _, v in pairs(character:GetDescendants()) do
if v:IsA("BallSocketConstraint") or v:IsA("Attachment") or v:IsA("WeldConstraint") then
v:Destroy()
end
end
for _, part in character:GetChildren() do
if part:IsA("BasePart") and part.Name:find(COLLIDER_NAME) then
part:Destroy()
end
end
for _, part in character:GetDescendants() do
if part:IsA("BasePart") then
part.AssemblyLinearVelocity = Vector3.zero
part.AssemblyAngularVelocity = Vector3.zero
end
end
task.wait()
for _, v in pairs(character:GetDescendants()) do
if v:IsA("Motor6D") then
v.Enabled = true
end
end
humanoid.PlatformStand = false
humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
humanoid:SetStateEnabled(Enum.HumanoidStateType.Freefall, true)
humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, true)
task.wait()
humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
humanoid.AutoRotate = true
humanoid.WalkSpeed = 16
humanoid.JumpPower = 50
humanoid.UseJumpPower = true
end
here u go
@lost surge lemme know if fixed
Welcome
it just kills the player 💔
hmmm
the issue is the task.wait() calls are causing problems
function ragdoll.Stop(character, player)
character:SetAttribute("Ragdolled", false)
local humanoid = character:FindFirstChildOfClass("Humanoid")
if not humanoid then return end
for _, v in pairs(character:GetDescendants()) do
if v:IsA("BallSocketConstraint") or v:IsA("Attachment") or v:IsA("WeldConstraint") then
v:Destroy()
elseif v:IsA("Motor6D") then
v.Enabled = true
end
end
for _, part in character:GetChildren() do
if part:IsA("BasePart") and part.Name:find(COLLIDER_NAME) then
part:Destroy()
end
end
for _, part in character:GetDescendants() do
if part:IsA("BasePart") then
part.AssemblyLinearVelocity = Vector3.zero
part.AssemblyAngularVelocity = Vector3.zero
end
end
humanoid.PlatformStand = false
humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
humanoid:SetStateEnabled(Enum.HumanoidStateType.Physics, false)
humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
humanoid:SetStateEnabled(Enum.HumanoidStateType.Freefall, true)
humanoid.AutoRotate = true
humanoid.WalkSpeed = 16
humanoid.JumpPower = 50
humanoid.UseJumpPower = true
humanoid:ChangeState(Enum.HumanoidStateType.Running)
end
try this
i dont think it fixes it, cause for some reason its stuck at falling down after checking the humanoid state
hmmmmmmmm
function ragdoll.Stop(character, player)
--existing cleanup code
humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, true) -- keep this enabled
humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, true)
humanoid:SetStateEnabled(Enum.HumanoidStateType.Freefall, true)
humanoid:ChangeState(Enum.HumanoidStateType.Freefall)
-- or try humanoid:ChangeState(Enum.HumanoidStateType.Running)
humanoid.PlatformStand = false
-- your code
end
Sorry for the late response! But i dont think any fixes would fix this 😭 i've tried this and other methods and currently im on this one right now:
and one thing i found is that, even if its at Running, it Changes BACK to FallingDown