Best way of preventing humanoid tripping?

I am looking for the best way to deal with humanoids tripping when they are spawned in. It seems like if they are not directly on the ground they will often trip right when they are brought into the workspace.
I’ve previously used bodygyros locked to the Y axis to prevent this, but they can cause issues with humanoids spinning/flinging away after attempting to correct a trip. I’ve also heard that Bodygyros are outdated, so I’d like to move to something better.
Would attachments with align orientation work better for this than bodygyros? Is there a way to just disable tripping altogether?
This is on custom NPCs that use humanoids, not sure if there are different rules for player character humanoids.

19 Likes

Try using this;
http://wiki.roblox.com/index.php?title=API:Class/Humanoid/SetStateEnabled
http://wiki.roblox.com/index.php?title=API:Enum/HumanoidStateType

Not sure if it’s exactly what you want, but it may help.
Believe FallingDown and RagDoll are the ones you’re looking for.

4 Likes

Don’t forget about Physics and maybe PlatformStand

3 Likes

You’re absolutely right, code I used:

local stateType = Enum.HumanoidStateType

local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")

humanoid:SetStateEnabled(stateType.FallingDown, false)
humanoid:SetStateEnabled(stateType.Ragdoll, false)

With no code:

With code:

TripFix.rbxl

65 Likes

Thanks guys, looks like this is what I needed.

10 Likes