I have the solution for the “Phase through object” bug.
You need to disable/enable the collision on the humanoidRootPart when the ragdoll is active/deactive. It’s set to always disabled when the ragdoll is created, but this is not correct.
function setRagdollEnabled(humanoid, isEnabled)
...
local rootPart = humanoid.Parent:FindFirstChild("HumanoidRootPart")
if rootPart then
rootPart.CanCollide = not isEnabled
end
end
Also it’s possible to simply send a manual event from the client to the server, when the clients humanoid state changes, and apply the state manually to the players humanoid on the server. This fixes the bug in 99.9% of cases.
My code for doing this is not super pretty, but it works well enough.
Hi, I was wondering if I should just ignore this error (wich btw, I get the second error on the screenshot 5 times on the output when I hit play) or not, since it works anyways and it also errors on the demo place. https://i.gyazo.com/89ff0a39ada6c9ba3fa15c3c49ca7139.png .
In that case, you need to remove line 40 from the RagdollTestScript script.
player.CharacterAppearanceLoaded:wait()
CharacterAppearanceLoaded will never happen since you are using a custom character model, so the ragdoll will never be built. I ran into this issue as well and removing this line fixed it for me.
I have an issue where the character being ragdolled flies up after being ragdolled and i think it could be because the player’s joints are colliding with the platform part. I tried fixing this by setting the player’s rootpart velocity to vector3.new(0,0,0) in a loop if they are in a ragdoll but this just makes my knockbacks look wierd. any solutions?
If anyone is having this issue, the solution i used is setting the Y axis of the player velocity to 0 whenever the player humanoid state is not FallingDown , FreeFalling or jumping
Yes hi, are you using a StarterCharacter? If you are then go into “RagdollTestScript” and remove this code from line 40:
player.CharacterAppearanceLoaded:wait()
Brief Explanation: CharacterAppearanceLoaded will never happen since you are using a custom character model
However if you are not using a Starter Character then go into “RagdollTestScript” and remove line 39 through 45 and replace it with this code
function characterAdded(player, character)
player.Character:WaitForChild('Humanoid', 60)
player.Character:WaitForChild('HumanoidRootPart', 60)
wait(0.1)
local humanoid = character:FindFirstChildOfClass("Humanoid")
buildRagdoll(humanoid)
end
both have worked for me so far and I hope it can help you too.