Character jumps around when turning off Ragdoll

:warning: ISSUE

Whenever a Players Character gets ragdolled, they always do this little jump / fling before standing up… sometimes it works and makes the Character stand with no weird jumps or bugs.

Here’s a video of the problem:

:gear: Un-Ragdoll Function

I’m assuming the jumping issue is either caused by the custom idle / walk and run animations I made OR through this function that makes the Character stand up from the ragdoll state.

function unragdollCharacter(character)
	local player = Players:GetPlayerFromCharacter(character)
	local humanoid = character:FindFirstChild("Humanoid")
	local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
	
	print(player)

	if player then

		if humanoid:GetState() == Enum.HumanoidStateType.Dead then return end
		humanoid.PlatformStand = false
		humanoid.AutoRotate = true
		humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
		humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
		humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing, false)
		humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)

		humanoid.WalkSpeed = 16
		humanoid.JumpPower = 50
	else
		if humanoid:GetState() == Enum.HumanoidStateType.Dead then return end
		humanoid.PlatformStand = false
		humanoid.AutoRotate = true
		humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
		humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
		humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing, false)
		humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)

		humanoid.WalkSpeed = 16
		humanoid.JumpPower = 50
	end

	destroyJoints(character)
	enableMotor6D(character, true)
	enableCollisionParts(character, false)

	local isRagdolled = character:SetAttribute("IsRagdolled", false)
end

any help or suggestions are appreciated! :slight_smile:

3 Likes

If you’ve ever played any games with ragdoll physics, you’ve probably seen that it might or might not fling player in same way as show in the video. This is just roblox’s physics and ragdoll mechanics, so you eather live with them or create your own ragdoll physics.

Try using this right after the players ragdoll ends,

		humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
		humanoidRootPart.AssemblyLinearVelocity = Vector3.zero

first it will change the humanoids state to GettingUp so the player will stand up faster,
then after that it will make sure the player dosnt bounce up when standing

unfortunately this didn’t solve the issue, I was thinking of changing the RootPart velocity but it doesn’t work…

Oh sorry, it needs to be repeated, try this

		repeat
			script.Parent.Humanoid:ChangeState(Enum.HumanoidStateType.GettingUp)
			task.wait()
		until script.Parent.Humanoid:GetState() ~= Enum.HumanoidStateType.FallingDown
		script.Parent.HumanoidRootPart.AssemblyLinearVelocity = Vector3.zero

Okay so, I just had a Lightbulb moment and came to realise… I was handling the ragdoll and unragdoll movements on the Server which causes A LOT of problems with flinging and other bugs like that… so I just made 2 remotes that fire that do the exact same code but on the Client… since it’s movement it gets Replicated on the Server anyway… regardless of that- thanks for the suggestions and ideas dude! :slight_smile:

Tp the character a bit above equal to the players humanoid.HipHeight + a small threshold number.

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