How to detect mobile jump input BEFORE humanoid state changes?

Is there any event or method on mobile that fires before the humanoid processes the jump?

On PC, InputBegan with Enum.KeyCode.Space fires before the humanoid state changes from Running to Jumping.

On mobile, every method I’ve tried (JumpRequest, TouchGui.JumpButton.MouseButton1Click, Activated) fires after the state has already changed to Jumping.

I need to know when the player pressed jump while still grounded, but on mobile the state is already Jumping by the time any callback runs.

I’m detecting a “second jump while airborne” for ledge climbing. On PC I can ignore the first jump because state is still Running when the input fires. On mobile I can’t tell if the input was the jump that launched me or a mid-air press, both show Jumping state.

2 Likes
humanoid:GetPropertyChangedSignal("Jump"):Connect(function()
    if humanoid.Jump then
        print("Humanoid.Jump")
    end
end)

try this cuh

3 Likes

tried and its the same issue, by the time it fires, the state is already Jumping
on pc InputBegan with Space fires before the State changes, all methods i tried (JumpRequest, MouseButton1Click, Humanoid.Jump signal) fires after state is already Jumping.

--LocalScript in StarterPlayerScripts
local UIS = game:GetService("UserInputService")
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid") --a stall

UIS.JumpRequest:Connect(function()
	print("Jump input detected before state change")
end)

It’s pretty quick, probably get two readings.

image
This is stupid??? @itwasross plz next time use your brain cells (not trying to be offensive)

Idk if that is to me but If not then I agree, brother really said he tested JumpRequest just for it to be suggested again and then suddenly work!!!

1 Like

lowk js wanted to close the post i tried smt else

Not really sure about the reasoning behind the behavior mentioned, but you could try storing the time when state was changed and within of the mentioned events above you could check the difference in time and work accordingly