How to detect if a player Tapped the Jump Button on Mobile

Am tryna detect if the player Has clicked the Jump button 2 times With the UserInputService

local UIS = game:GetService("UserInputService")
local LastPress = 0

UIS.InputBegan:Connect(function(input,isTyping)
	if isTyping then return
	elseif input.KeyCode == Enum.KeyCode.Space then
                local CurrentTime = tick()
	       	if CurrentTime - LastPress <= 0.5 then
		    print("Double Clicked")
               end
	end
end)

but the issue with this is, it doesnt work on mobile as it doesnt print if i tapped the “JUMP” button screen
is there any other way to detect?? (not looking for Humanoid.StateChanged solution)

UIS.JumpRequest:Connect(function)
    --code
end)
8 Likes

https://developer.roblox.com/en-us/api-reference/event/Humanoid/Jumping

Jumping does not work properly especially with checking for detection. I recommend UIS.JumpRequest as @creeperasur said

Depends if you want to check if the player’s character jumped twice or if they attempted to jump twice, I wasn’t sure as the thread’s prompt is ambiguous.

1 Like

Wish they had a way to detect jumping with mobile touchscreen ;-;

Why do you want to check this when you can simply just use a jumpRequest event?

I will try that, I was just being lazy about it :joy: