I need help fixing a gltich in my ragdoll module

As you probably can see in the video the ragdoll works pretty smoothly and i am kinda happy of how i turned out, BUT there is a problem after unragdolling the character, does anybody know what happens that makes the character fling like that?

I tried using someones else idea to fix this but it just didnt work

	local root = character:FindFirstChild("HumanoidRootPart")
		if root then

			local liftY = 2
			local position = root.Position + Vector3.new(0, liftY, 0)

			local targetCFrame = CFrame.new(position) * CFrame.Angles(0, root.Orientation.Y, 0)

			local tween = TweenService:Create(root, TweenInfo.new(.3, Enum.EasingStyle.Quad, 		Enum.EasingDirection.Out), {
			CFrame = targetCFrame
		})
			tween:Play()
			tween.Completed:Wait()
		end

	task.wait(0.4)

	local humanoid = character:FindFirstChildWhichIsA("Humanoid")
	if humanoid then
		humanoid.PlatformStand = false
		humanoid.AutoRotate = true
	end
end

If you have any idea please tell me!

set humanoid state getting up.
Should fix that

Thats the weird part. I also thought it would fix the issue however it didnt, i tried looking at forum for some other solutions but couldnt find any + i already do it earlier in the code.

that could be heppening becouse you gain/regain network ownership of an npc perhabs?

I checked and it also doesnt help with the error

Have you tried using:

root.Velocity = Vector3.new(0,0,0)
root.RotVelocity = Vector3.new(0,0,0)

before setting PlatformStand to false? it looks like the character has some extra velocity after “getting up”

1 Like

Oh, wow that worked very well, thank you kind sir, but as it turns out there is another “glitch” or just a thing that i want to change is this kind of animation after the character gets up. what is it and what couses it? The character gets in the ground and performs this weird thing.

No problem! I’m glad it worked. Could you mark that it as the solution please?

And I think that weird “legs in the ground” thing is PlatformStand ending slightly after the character gets up? maybe try disabling PlatformStand something like 0.25 seconds before the rest of the “getting up” code…

I removed the task.wait(0.4) and now the character doesnt glitch into to floor, but the animation is till being played and i have no idea what it is.

That might be the character going back to its normal position after finishing the “getting up” animation? if I’m looking at the right thing (the character moving its arms, head legs in a strange way)

If that is what the issue is, this could work (it should get the idle animation and remove the weird transition we’re seeing):

for _, track in pairs(animator:GetPlayingAnimationTracks()) do
	if track.Name:lower():find("idle") then
		track:AdjustWeight(1, 0)
	end
end

this doesnt work, however thank you very much again for your help.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.