How can I detect the when the player pressed the mobile jump button?
I never used ContextActionService before and I have a simple double jump mechanic with climbing.
My code:
function JumpDetect()
print('r')
if doubleJumped then
onJumpRequest()
end
end
cas:BindAction("JumpDetect", JumpDetect, false, Enum.KeyCode.Space, Enum.KeyCode.ButtonA)
EDIT: I do not want to use JumpRequest because low debounce time doesnn’t work on it.
local player = game.Players.LocalPlayer
local jumpButton = player.PlayerGui.TouchGui.TouchControlFrame.JumpButton
jumpButton.Activated:Connect(function()
print("Jump button pressed")
end)
Warning if Roblox makes any changes in the future to where the jump button is it will most likely break your script
Also this article might help you setup double jump