Animations Fail To Play After Ragdoll Recovery

I have been working on a ragdoll system for my game, although whenever I try rebuilding the player after ragdolling, the animations of the player don’t seem to play, sometimes it continues playing the falling animation, or not even playing any animation. I believe it may be something to do with the humanoid state types, how should I fix this?

Unragdoll:

Summary
function Ragdollmodule:Rebuild(character,Backtable)
	
	local jointTable = Backtable[1]
	local socketTable = Backtable[2]
	
	if character:FindFirstChild("HumanoidRootPart") then
		if character.HumanoidRootPart:FindFirstChild("HumWeld") then
			character.HumanoidRootPart.HumWeld:Destroy()
		end
	end
	
	for i, socket in pairs(socketTable) do
		socket:Destroy()
	end
	
	for i, joint in pairs(jointTable) do
		joint.Enabled = true
	end
	-- fix the humanoid types
	local hum = character.Humanoid
	character.HumanoidRootPart:SetNetworkOwner(nil)
	
	hum:ChangeState(Enum.HumanoidStateType.Ragdoll,false)
	hum:ChangeState(Enum.HumanoidStateType.Physics)
	hum:SetStateEnabled(Enum.HumanoidStateType.PlatformStanding,true)
	hum:SetStateEnabled(Enum.HumanoidStateType.PlatformStanding,false)

	
	character.Humanoid.PlatformStand = false
	
	hum:ChangeState(Enum.HumanoidStateType.Ragdoll,false)
	hum:ChangeState(Enum.HumanoidStateType.Physics,false)
	hum:ChangeState(Enum.HumanoidStateType.PlatformStanding,false)
	hum:ChangeState(Enum.HumanoidStateType.Physics,false)
	--hum:ChangeState(Enum.HumanoidStateType.None)
	hum:ChangeState(Enum.HumanoidStateType.Ragdoll,false)
	hum:ChangeState(Enum.HumanoidStateType.Physics,false)
	hum:ChangeState(Enum.HumanoidStateType.PlatformStanding,false)
	hum:ChangeState(Enum.HumanoidStateType.Physics,false)
	hum:ChangeState(Enum.HumanoidStateType.Freefall,false)
	hum:ChangeState(Enum.HumanoidStateType.GettingUp)
	
	hum.AutoRotate = true
	hum.WalkSpeed = 16
end

I have tried setting some more types and unsetting the types and still have the issue. Anybody who tends to use humanoid types, is there anything I might be missing?
Thank you for any help you may provide.

Have you tried disabling and reenabling the animation script?

1 Like

I recently had the same problem, try reparenting all welds to where they originally were then disable and enable the “Animate” localscript.

1 Like

Alright I will try that!
@NeoIsSad
@LazaroValkyrie

Edit: I have tried it and seemed to not fix it.

	hum.AutoRotate = true
	hum.WalkSpeed = 16
	character.Animate.Disabled = true
	character.Animate.Disabled = false

Any other ideas? Seems to possibly be humanoid related, although I have unset what I have set.

Actually seems to be playing the idle animation but nothing else.

Ya it still doesn’t work for me, It only works when a tool is equipped/unequipped.