Humanoid falls over

Hey again folks, trying to make a horror game aspect thingy here you see yourself walking down a flight of stairs. Haven’t gotten to making the humanoid move yet as this problem has left me (unfortunately) stumped.

here is my code, (it is in a localscript in StarterGUI for reference)

local players= game:GetService("Players")
	local rig = game.ReplicatedStorage.DummyStairs:Clone()
	local desc = players:GetHumanoidDescriptionFromUserId(game.Players.LocalPlayer.UserId)
	rig.Parent = game.Workspace
	task.wait(0.1)
	local hum = rig:WaitForChild("Humanoid")
	hum:ApplyDescription(desc)
	rig:PivotTo(spawns.CFrame)	
	hum:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
	hum:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
	rig.HumanoidRootPart.Anchored = false
	task.wait()
	local walk = rig.Humanoid.Animator:LoadAnimation(rig.Humanoid.Walk)
	walk:Play()
	hum:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
	hum:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)

The character is supposed to spawn, and then play the walk animation. The only problem is that whenever it spawns it falls over and falls down the stairs and i literally cannot prevent it no matter what i try. I’m about to lose my mind. Please help!!

Thanks everyone :smiley:

A bit late, but I also encountered this issue and managed to get it fixed by adding these two lines:

hum:SetStateEnabled(Enum.HumanoidStateType.Freefall, true)
-- then set it to false after it has reached the ground
hum:SetStateEnabled(Enum.HumanoidStateType.Freefall, false)

tysm! i’ll try this when my development burnout fades away and i start working on the game again!

1 Like