Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago

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

Log in to vote
0
Answered by
bjr29 40
5 years ago
Edited 5 years ago

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.

Ad

Answer this question