Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do to make your script indicate a humanoid is falling?

So i ugh i dont know how to use StateChanged or GetState or humanoidstatetype anyone wanna help me understand it,since i just found this at Api!

1 answer

✓ Accepted answer

An easy solution would to get the Y velocity of HumanoidRootPart and check if it's velocity is smaller than 0.

Local Script

local player = game.Players.LocalPlayer
local character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:wait()
local humanoidRoot = character:WaitForChild("HumanoidRootPart")
   
while wait() do
	if(humanoidRoot.Velocity.Y < -0.2) then
		print("Falling")
	end
end

The reason it's not just 0, it's just makes it less likely to detect a step as falling, you can set it to 0 if you don't like this.

This discussion is preserved as it was. New answers, comments, and votes are closed.