Ragdoll Glitch ︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎

Hi guys!
Then I have a bug that I don’t know what to call it, so I call it the ragdoll glitch
And I also don’t know how to fix it, if you help me I would be very grateful!!!

*Sorry if my english too bad

VIDEO:

My Script:

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local humrp = char:WaitForChild("HumanoidRootPart")
local rp = game:GetService("ReplicatedStorage")
local CameraShaker = require(rp.Module.CameraShaker)
local camera = workspace.CurrentCamera



local rs = game:GetService("RunService")
local debounce = false

local animation = {
	W = script.Animation.W,
	S = script.Animation.S,
	A = script.Animation.A,
	D = script.Animation.D
}

local W = false
local D = false
local A = false
local S = false

local function Dash(MoveDirection,anims, enable)
	print("made velocity")
	local velocity = Instance.new("BodyVelocity",humrp)
	velocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
	velocity.Velocity = MoveDirection * 70
	game.Debris:AddItem(velocity,.645 /2)
	local tracks = hum.Animator:LoadAnimation(animation[anims])
	tracks.Priority = Enum.AnimationPriority.Action4
	tracks:Play()
end

local uis = game:GetService("UserInputService")
uis.InputBegan:Connect(function(input,isT)
	if isT then return end
	local moveDirection = hum.MoveDirection
	if input.KeyCode == Enum.KeyCode.Q and not debounce and moveDirection.X ~= 0 and moveDirection.Z ~= 0 and hum:GetState() ~= Enum.HumanoidStateType.Jumping and hum:GetState() ~= Enum.HumanoidStateType.Freefall then
		
		debounce = true
		script.Effect:FireServer()
		
		require(rp.Module.CameraShake)(humrp.Position,5,1,0.645/2)
		if W and D then
			Dash(moveDirection,"D")
		elseif W and A then
			Dash(moveDirection,"A")
		elseif S and D then
			Dash(moveDirection,"D")
		elseif S and A then
			Dash(moveDirection,"A")
		elseif W then
			Dash(moveDirection,"W")
		elseif S then
			Dash(moveDirection,"S")
		elseif A then
			Dash(moveDirection,"A")
		elseif D then
			Dash(moveDirection,"D")
		end
		
		task.delay(.8,function()
			debounce = false
		end)
	end
end)


rs.RenderStepped:Connect(function()
	if uis:IsKeyDown(Enum.KeyCode.W)  then
		W = true
	else
		W = false
	end
	if uis:IsKeyDown(Enum.KeyCode.A)  then
		A = true
	else
		A = false
	end
	if uis:IsKeyDown(Enum.KeyCode.S) then
		S = true
	else 
		S = false
	end
	if uis:IsKeyDown(Enum.KeyCode.D) then
		D = true
	else 
		D = false
	end
end)




I’m guess that the ramp is set to speed up a player who touches it? If so, you’re running into Roblox’s physics with, you guessed it, ragdolling. You’ll want to use SetStateEnabled to set the Ragdoll state to false, like so:

(LocalScript in StarterCharacterScripts, server script should work fine too.)

local character = script.Parent
local humanoid = character:WaitForChild('Humanoid')
humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,false)

that ramp just for test and not speed up, im making a dash system

That would explain the ragdolling as well. Did my solution solve your issue?

it doesn’t fix :frowning: ︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎︎ ︎

You can also try:

humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown,false)

This seems to work, but still has an undesirable “rotation”. I’ll try to get a better solution.

This isn’t the best solution, but I’m sure you can edit it to better fit your needs. I commented out the stuff I couldn’t use, so you’ll have to revert that as well:

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local humrp = char:WaitForChild("HumanoidRootPart")
local rp = game:GetService("ReplicatedStorage")
--local CameraShaker = require(rp.Module.CameraShaker)
local camera = workspace.CurrentCamera

hum:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,false)
hum:SetStateEnabled(Enum.HumanoidStateType.FallingDown,false)



local rs = game:GetService("RunService")
local debounce = false

--local animation = {
--	W = script.Animation.W,
--	S = script.Animation.S,
--	A = script.Animation.A,
--	D = script.Animation.D
--}

local W = false
local D = false
local A = false
local S = false

local function Dash(MoveDirection,anims, enable)
	--print("made velocity")
	local velocity = Instance.new("BodyVelocity",humrp)
	velocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
	velocity.Velocity = MoveDirection * 70
	game.Debris:AddItem(velocity,.645 /2)
	--local tracks = hum.Animator:LoadAnimation(animation[anims])
	--tracks.Priority = Enum.AnimationPriority.Action4
	--tracks:Play()
end

local uis = game:GetService("UserInputService")
uis.InputBegan:Connect(function(input,isT)
	if isT then return end
	local moveDirection = hum.MoveDirection
	if input.KeyCode == Enum.KeyCode.Q and not debounce and moveDirection.X ~= 0 and moveDirection.Z ~= 0 and hum:GetState() ~= Enum.HumanoidStateType.Jumping and hum:GetState() ~= Enum.HumanoidStateType.Freefall then

		debounce = true
		task.spawn(function()
			local y = humrp.Orientation.Y
			while debounce do
				humrp.CFrame = CFrame.new(humrp.Position) * CFrame.Angles(0,math.rad(y),0)
				task.wait()
			end
		end)
		--script.Effect:FireServer()

		--require(rp.Module.CameraShake)(humrp.Position,5,1,0.645/2)
		if W and D then
			Dash(moveDirection,"D")
		elseif W and A then
			Dash(moveDirection,"A")
		elseif S and D then
			Dash(moveDirection,"D")
		elseif S and A then
			Dash(moveDirection,"A")
		elseif W then
			Dash(moveDirection,"W")
		elseif S then
			Dash(moveDirection,"S")
		elseif A then
			Dash(moveDirection,"A")
		elseif D then
			Dash(moveDirection,"D")
		end

		task.delay(.8,function()
			debounce = false
		end)
	end
end)


rs.RenderStepped:Connect(function()
	if uis:IsKeyDown(Enum.KeyCode.W)  then
		W = true
	else
		W = false
	end
	if uis:IsKeyDown(Enum.KeyCode.A)  then
		A = true
	else
		A = false
	end
	if uis:IsKeyDown(Enum.KeyCode.S) then
		S = true
	else 
		S = false
	end
	if uis:IsKeyDown(Enum.KeyCode.D) then
		D = true
	else 
		D = false
	end
end)

Basically, during the dash part, I put a loop to lock the HumanoidRootPart’s orientation until the debounce has ended.

Just from a quick glance, try one of these things:

hum:ChangeState(Enum.HumanoidStateType.Physics);
hum.PlatformStand = true;
hum.AutoRotate = false;