I need help with preventing an NPC from tripping

I am currently working on a story game and at the end part, I have some problems with keeping the NPC from tripping. If you don’t know what I mean, it’s a humanoid state called FallingDown which makes the humanoid have no animation and lie down on the floor for a few moments and then get back up. The screenshot is what I mean:

I did find a solution that could keep this from happening and it was called SetStateEnabled and it was exactly what I needed. I added it to then code and it sort of worked. It didn’t exactly disable the FallingDown state for the NPC. It did try to stop it, but it didn’t stop it immediately and it didn’t stop it on time. The scenario that I’m using it is that your two friends are falling off a platform into the lava, but they’re hanging on the edge. You save one of them on time and pull them up back to the platform. That stuff worked but I got this FallingDown state. I couldn’t really find anything that helped.

Hello,
You should anchored they HumanoidRootPart’s
And then tween HumanoidRootPart to position you need.

try to disable ragdolls too

Humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll,false)

The NPC’s HumanoidRootPart needs to be unanchored. The HumanoidRootPart needs to be unanchored due to the NPC’s movement.

Couldn’t you also use that code to change FallingDown to be disabled too?

1 Like

I did anchor the HumanoidRootPart. Instead of tweeting, I did animating

1 Like

I think that is the problem. However, If I do that, the NPC will just simply fall into the lava. I’ve tested it.

I know this is a nasty bump, but if anyone else is having this problem and can’t find a fix, the solution is the same as stopping a player from tripping. You have to disable the FallingDown state on the NPC’s humanoid from a LocalScript rather than on the server.

3 Likes

and how might i do that? is it just SetStateEnabled inside a local script?

ps, also sorry for the bump

1 Like

Should be Humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false) on a local script.

2 Likes

I know this is an old post, but if anyone still needs this, this worked for me. Put this in a server script parented to the NPC/Dummy.

Local Character = script.Parent
Local humanoid = Character:WaitForChild("Humanoid")
humanoid.StateChanged:Connect(function()
	humanoid:SetStateEnabled(Enum.HumanoidStateType.FallingDown, false)
	humanoid:SetStateEnabled(Enum.HumanoidStateType.GettingUp, true)
	humanoid:SetStateEnabled(Enum.HumanoidStateType.Ragdoll, false)
end)
2 Likes