Ragdoll doesnt fall

When the character dies while standing, the character stands still and doesnt fall until you move it
image

function ragdoll:newragdoll(character,respawntime)
	
	
	for index,joint in pairs(character:GetDescendants()) do
		if joint:IsA("Motor6D") and joint:FindFirstAncestor("Accessories") == nil then
			--if joint:FindFirstAncestor("Accessories") then return end
			local socket = Instance.new("BallSocketConstraint")
			local a1 = Instance.new("Attachment")
			local a2 = Instance.new("Attachment")
			a1.Parent = joint.Part0
			a2.Parent = joint.Part1
			socket.Parent = joint.Parent
			socket.Attachment0 = a1
			socket.Attachment1 = a2
			a1.CFrame = joint.C0
			a2.CFrame = joint.C1
			socket.LimitsEnabled = true
			socket.TwistLimitsEnabled = true
			--joint.Parent.CanCollide = true
			joint:Destroy()
		end
	end
end

i’ve tried giving it force but it doesnt even move and idk why and how to fix this

alr i have found a way by adding linearvelocity and this time it works. i also added raycast to detect if the character is in the air so he doesnt flip, althought is there a better way to do this?

1 Like

maybe add a slight :ApplyImpulse as an easy way to get it to fall?

1 Like

You need to set the PlatformStand property of Humanoid to true
Humanoid.PlatformStand

i’ve tried doing that but that doesnt work, same goes to :applyimpulse.

Hey, on the client of the player being ragdolled try running this code locally

For when the player is getting ragdolled

Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, false)
Humanoid:ChangeState(Enum.HumanoidStateType.Physics)

For when the player is being unragdolled

Humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)

If the character being ragdolled is an NPC and has no client attached to it- set the HumanoidRootPart’s network ownership to nil then repeat the same code above but run the aforementioned code above on the server.

1 Like

this doesnt work because it makes all the scripts be on a constant loop for some unknown reason (im talking about the physics) and it also doesnt make my player fall down

Is the HumanoidRootPart Anchored? or any parts in the character model for that matter?

No, i just checked every part. Nothing is anchored

Did you run my code on the client? Is your ball and socket joint code script on the server or client? If on the server have you tried utilizing RemoteEvents to run my aforementioned code? Please let me know! :heart:

i apologize for the wait, as im quite busy nowadays with exams, the ballsocketjoint is run on the server after the humanoid has died, then, it runs a module script, which runs the ballsocket join function. i put your code on the client by simpling putting humanoid.died:connect(function()) event, i even did use this on the server too but for some reason it does the same problem

hello im back, i fixed the code you sent to me. i was thinking of a way to use the function without on the loop, and i found out that using once instead of connect fixed the loop. it made the fall much smoother, howerver, the standing problem still occurs. and i really dont know if using raycast and linearvelocity is an efficent way

i guess for now this is it
gotta write extra

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