Does any of you guys know of a reliable way to detect when a player jumps?

Im trying to get reliable jump detection. So far i have tried:

Humanoid:GetPropertyChangedSignal("Jump")
Humanoid.Jumped

These two methods arent reliable, the events are fired multiple times and sometimes not at all. If possible id like to not resort to raycasting, detecting when the client press space isnt an option either.

7 Likes

Seems like you can use Humanoid.FloorMaterial for reliable detection.

8 Likes

UserInputService.JumpRequest

Works on mobile etc too as well as pc.

3 Likes

Maybe its just outdated idk, worth considering though.

1 Like

I would probably use either ContextActionService:BindAction or Humanoid.StateChanged to bind a function:

-- Using ContextActionService:BindAction

ContextActionService:BindAction("OnJump", function(actionName, inputState, input)
    -- proc here
    return Enum.ContextActionResult.Pass
    -- this enum passes processing to the 
    -- next action in line, most likely to the 
    -- ControlScript.
end, false, Enum.PlayerActions.CharacterJump)

-- Using Humanoid.StateChanged

Humanoid.StateChanged:Connect(function(old, new)
    if new == Enum.HumanoidStateType.Freefall and (
            old == Enum.HumanoidStateType.Running 
            or old == Enum.HumanoidStateType.RunningNoPhysics
    ) then
        -- proc here
    end
end)
8 Likes

Pretty sure StateChanged isn’t viable as its directly related to .Jumping. .Jumping fires when the humanoid state transitions to “jumping” I’m pretty sure.

I’m guessing you have been using Humanoid.Jumping's boolean active argument…

And I just found out that Enum.HumanoidStateType.Jumping is a thing:

Humanoid.StateChanged:Connect(function(old,new)
    if 
        new == Enum.HumanoidStateType.Jumping and
        --old == Running or RunningNoPhysics
    then
        --proc here
    end
end)

None of it probably means anything, but yeah.

StateChanged on Jumping and using the Jumping event should give you relatively the same results.

> This event fires when the Humanoid enters and leaves the Jumping HumanoidStateType .

Jumping

  • If active (HumanoidStateType is Jumping)
    • Something

StateChanged

  • If jumping
    • Something
2 Likes

An even better way would be
Humanoid.Changed:Connect(function()
if Humanoid.Jump == true then
end
end)

1 Like

I already tried that and it doesn’t do the trick sadly.