I’m creating a game and I want to implement a ragdoll system. I managed to create a ragdoll, but I want it to clone the player character and spawn exactly where the player died.
The problem is, I keep getting Parent is nil errors. I’ve tried several approaches but I can’t figure out what’s going wrong.
Has anyone successfully cloned a character at the exact death position without running into parent issues? Any guidance would be really appreciated!
1 Like
yo i ran into this exact thing before — it can be super annoying 
basically, the “Parent is nil” thing usually happens when you try to set properties or weld stuff on a model before actually parenting it to the workspace. especially with cloned characters, stuff can get weird real fast if you don’t do it in the right order.
what worked for me was:
- clone the character
- set its
PrimaryPart (if it doesn’t already have one)
- set the
CFrame of the model using the HumanoidRootPart
- then parent it to workspace
something like this:
local ragdoll = player.Character:Clone()
ragdoll.Name = player.Name .. "_Ragdoll"
local hrp = ragdoll:FindFirstChild("HumanoidRootPart")
if hrp then
ragdoll:SetPrimaryPartCFrame(hrp.CFrame)
ragdoll.Parent = workspace
else
warn("No HumanoidRootPart found")
end
also make sure you’re disabling/removing the humanoid in the clone (or switching it to ragdoll joints) after cloning so it doesn’t get up and walk like nothing happened lol
2 Likes
Have you tried setting the “Archivable” property to true, before cloning the player’s character? Players’ characters have this property on false default.
before cloning the character, make it archivable, and maybe anchor all of its descendants, then wait a bit and unanchor the clone and it may be good
Thanks I will test it like I had so much issues
Nope I didn’t try juju is saying the game thing I will try I hope it works
i like idEAS TRUST IT WORKEDS
CINEMA
Make a lethal surgery on a Robloxian, replacing their ankles with BallSocketConstraint.
1 Like