How to make punch ragdoll affected by gravity

heres a vid showing what happens:

( dont mind there being no animations im gonna add )

heres what i want:

if u dont get it, i want the ragdoll to be affected by gravity but its just levitatiing, heres my ragdoll part:

local function applyRagdoll(hitCharacter)
	if hitCharacter:FindFirstChild("Humanoid") and not hitCharacter:FindFirstChild("RagdollModel") then
		local ragdollModel = script:FindFirstChild("RagdollModel"):Clone()
		ragdollModel.Parent = hitCharacter
		ragdollModel.Falllol.Disabled = false

		local middle = ragdollModel:FindFirstChild("Middle")
		if not middle then return end

		for _, part in ipairs(ragdollModel:GetChildren()) do
			if part:IsA("Part") then
				local weld = Instance.new("Weld")
				weld.Part0 = middle
				weld.Part1 = part

				local CJ = CFrame.new(middle.Position)
				weld.C0 = middle.CFrame:Inverse() * CJ
				weld.C1 = part.CFrame:Inverse() * CJ
				weld.Parent = middle
			end
		end

		local torso = hitCharacter:FindFirstChild("Torso") or hitCharacter:FindFirstChild("UpperTorso")
		if torso then
			local torsoWeld = Instance.new("Weld")
			torsoWeld.Part0 = torso
			torsoWeld.Part1 = middle
			torsoWeld.C0 = CFrame.new(0, 0, 0)
			torsoWeld.Parent = torso
		end

		for _, item in ipairs(ragdollModel:GetChildren()) do
			if item:IsA("Part") then
				item.Anchored = false
				item.CanCollide = true  -- Allow parts to collide with the ground
			end
		end

		local humanoid = hitCharacter:FindFirstChild("Humanoid")
		if humanoid then
			humanoid.PlatformStand = true
		end

		task.delay(3, function()
			if humanoid then
				humanoid.PlatformStand = false
			end
		end)
	end
end

This isn’t a particular solution outside of what you are already doing, and I’m sorry if this doesn’t help, but you could try changing the “if item:IsA(“Part”)” line to be:

if item:IsA(“BasePart”)

Since some parts might have physical properties keeping the character up without being an actual part itself.

1 Like

oh ye thx for reminding i normally do basepart i just forgot

1 Like

i still have this problem can anyone help

Just some suggestions. Not sure if any will work, but anything is worth a shot.

Try these and see if any work:

:ChangeState(Enum.HumanoidStateType.ragdollModel)
:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)

Or, try changing the AlignOrientation or maybe applying LinearVelocity or AngularVelocity to the root part.

See if these 4 suggestions work

where would i add these? in the script

I had this problem too:

Disable these 2 properties at the beginning of a server script:

Character.Humanoid.BreakJointsOnDeath = false
Character.Humanoid.RequiresNeck = false

I fixed it using an int value and detect ing its change in the client, and then change humanoidstates like gettingup to false and ragdoll to true when ragdolled.

Also make sure to push the player when they ragdoll using applyimpulse a little bit.

Another solution is to change the network ownership of the ragdolled player to the player attacking, And also if anyone attacks a player while he’s ragdolled, Change his network ownership to that player that attacked, The network ownership should return to default naturally when the player gets up from ragdoll.

apply impulse is in another function for knockback, i disabled the 2 properties, keep in mind this ragdoll doesnt kill, doesnt work, also the ragdoll stops locomotion of the rig midway stopping the impulse

set the humanoid state to Physics

local Humanoid = hitCharacter:FindFirstChild("Humanoid")
Humanoid:ChangeState(Enum.HumanoidStateType.Physics)

put this after ragdollModel.Falllol.Disabled = false in your script

how would i un set it after he has to get up, also it works but abrupts apply impulse

I do not know a work-around for the apply impulse delay, but to unset it simply just put

Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)

right after it unragdolls

um ok now it works but it stops apply impulse? should i remove this ragdollmodel stuff to check ( it doesnt delay, it just doesnt happen with ragdoll )

can you send a video of what it looks like?

with ragdoll (also he stopped getting up… ):

without ragdoll:

…Interesting, I am afraid I have literally no idea what is going on here… I used this method for my ragdoll engine and it works just fine. Maybe try tweaking around with the code a bit?

nvm i got it to work, found out there was a very slight velocity added to the character in a script in ragdollmodel, removing that fixed it imma mark ur phsyics think as solution though cuz that made it affected by gravity

1 Like