[Updated] Perfect R6 Ragdoll - Easiest Ragdoll System for R6 Avatars

Is there a way to make the unragoll instant?

1 Like

is not not instant? what do you mean

1 Like

There is a short few-second delay when changing the value on the server to false. It’s causing some unintended issues when I want to unragdoll a player and play an animation on them.

Example without ragdoll:


Example with ragdoll:

1 Like

Hello. May I ask why at the moment i change the Gettingup becomes true, and when they climbing , it will make the player float to the sky

1 Like

So i found a bug that prints a error when you ragdoll then die.

Change this line of code:

RagdollValue.Changed:Connect(Ragdoll)
Humanoid.Died:Once(function()
	RagdollValue.Value = true
end)

With this:

RagdollValue.Changed:Connect(Ragdoll)
Humanoid.Died:Once(function()
	if not RagdollValue then
		RagdollValue.Value = true
	end
end)
1 Like

Hey ive tried using this for my game and for some reason it sometimes decides to not let the ragdolls fall. Do you know any way to fix this?

What do you mean? Describe how you are using the system.

I have a whole system that has a module script that can detect when any model has a “DamageHandler” which is a script that just handles knockback, stunning, and wether or not the damage actually damages, and the script will make ragdoll true when the damageevent is activated. It turns the ragdoll to false after a certain stun time. But the problem is that sometimes when the player ragdolls or any npcs ragdoll, it just lets them hang in place. the dont fall over even with knockback force.

cant really show any footage rn because my thing suddenly decided i cant attack the dummy i set up. but i think the humanoid isnt changing states or something? Edit: Also wanted to say, for some reason the ragdolls all have a choppy movement. Almost like they have a lower framerate compared to everything else.

robloxapp-20231003-1852062.wmv (3.2 MB)
how to fix flying issue? (on npcs)

In the RagdollR6 script I removed the NeckRequired set to false line and it worked fine for me, the ragdoll works properly and when I fall into the void, ragdolled or not, I will respawn. Hope this helps! :+1:

1 Like

I had neck required set to false for my game and realised it wont be useful for others so ill update this and remove that line,

3 Likes

Bro you honestly just saved me hours of work :hushed:

4 Likes

Does this work with Roblox’s new character controllers? Releasing Character Physics Controllers - #272 by Varonex_0

Yea should work fine as long as they dont break humanoid states.

1 Like

ragdoll - Clipped with Medal.tv so I tried changing the boolValue ingame and as you can see, the character moves for a split second after the boolValue is set to true before returning to normal. I think it might be because of my script that handles humanoid states?

Here it is for reference:

Script
local RunService = game:GetService("RunService")
local ContextActionService = game:GetService("ContextActionService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid : Humanoid = character:WaitForChild("Humanoid")
local humanoidRootPart: BasePart = character:WaitForChild("HumanoidRootPart") 

local controllerManager: ControllerManager = character:WaitForChild("ControllerManager")
local groundController: GroundController = controllerManager:WaitForChild("GroundController")
local airController: AirController = controllerManager:WaitForChild("AirController")
local groundSensor: ControllerPartSensor = controllerManager.GroundSensor
local currentMovestyle = controllerManager:GetAttribute("CurrentMovestyle")

local Animations = require(ReplicatedStorage.Animations.Package.AnimationsClient)

local GrindBindable = ReplicatedStorage.Remotes.GrindBindable
local ShiftLockBindable = ReplicatedStorage.Remotes.ShiftLockBindable

local function updateMovementDirection()
	local desiredDirection = humanoid.MoveDirection
	controllerManager.MovingDirection = desiredDirection

	if desiredDirection.Magnitude > 0 then -- Is the character currently moving?
		controllerManager.FacingDirection = desiredDirection
	else -- Character not moving
		controllerManager.FacingDirection = controllerManager.RootPart.CFrame.LookVector
	end
end

local function updateControllerManagerSensor()
	local raycastParams = RaycastParams.new()
	raycastParams.FilterDescendantsInstances = {character}
	raycastParams.FilterType = Enum.RaycastFilterType.Exclude

	local raycastToGround = workspace:Raycast(humanoidRootPart.Position, Vector3.new(0, -4.5, 0), raycastParams)

	if raycastToGround then -- Character is running on the ground, raycast returned something
		groundSensor.SensedPart = raycastToGround.Instance
		groundSensor.HitNormal = raycastToGround.Normal
		groundSensor.HitFrame = CFrame.new(raycastToGround.Position)

		humanoid:ChangeState(Enum.HumanoidStateType.Running) 
		controllerManager.ActiveController = groundController
	else -- Character is midair, raycast didn't return anything
		humanoid:ChangeState(Enum.HumanoidStateType.Freefall) 
		controllerManager.ActiveController = airController
	end
	
	return controllerManager.ActiveController
end


local function doJump(actionName, inputState)
	if actionName == "JUMP_ACTION" and inputState == Enum.UserInputState.Begin then
		local jumpImpulse = Vector3.new(0, 550, 0) -- jump power

		controllerManager.RootPart:ApplyImpulse(jumpImpulse)
		
		-- Jumping anim changes based on current movestyle
		local jumpTrack = Animations:GetTrack(string.format("%s.Jump", controllerManager:GetAttribute("CurrentMovestyle")))
		jumpTrack.Looped = false 
		jumpTrack:Play()
		
		humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
		
		local floor = controllerManager.GroundSensor.SensedPart
		if floor then
			floor:ApplyImpulseAtPosition(-jumpImpulse, controllerManager.GroundSensor.HitNormal)
		end
	end
end

RunService.PreAnimation:Connect(function()
	local currentController = updateControllerManagerSensor()
	updateMovementDirection()
	airController.MoveMaxForce = humanoidRootPart.AssemblyLinearVelocity.Magnitude * controllerManager.BaseMoveSpeed
	
	if currentController == groundController and groundSensor.SensedPart.Name ~= "Rail" then  
		ContextActionService:BindAction("JUMP_ACTION", doJump, true, Enum.KeyCode.Space)
	else 
		ContextActionService:UnbindAction("JUMP_ACTION")
	end	
end)

You are suppose to change the BoolValue from a server script since the joints are created on the server.

Try using a remote event and see if it works.

And for the humanoid states, just make sure you dont change it while the ragdoll is active.

Untitled - Clipped with Medal.tv Works like a charm, thanks! But is there a way you can think of that I can use to stop the HRP from staying upright? I already know how to restrict the player’s controls

This is because the humanoid state is not Enum.HumanoidState.Ragdoll. In your LocalScript try checking is the BoolValue is set to true. If it is then set the HumanoidState to ragdoll.

1 Like

This works! I just had to comment out the RunService connection that handles updating the controller and the sensors, but I’ll get around to having an actual implementation soon. If anyone’s using ragdolls with the character controllers, try this module!

1 Like