How can I detect if a mobile player is holding the jump button?

I’m trying to detect if the player is holding jump or not. For xbox and pc I could just use user input service and detect if the player is holding space or the A button.

There is no equivalent for this with mobile players so what could I do instead?

1 Like

UserInputService.JumpRequest

This only detects when they press the jump button. Not when they are holding it down.

1 Like

Check this out since it is true whenever the play is in the air.

You could also check the humanoid’s floor material, when it is Enum.FloorMaterial.Air it means that the player is off the floor

But I don’t know how you’d counter when the player touches the floor ahain

1 Like

You could connect an event onto the actual jump button for mobile. Run a playtest using the phone emulator and the jump button is in the path below vvv
image

4 Likes

@DataSigh 's solution for detecting if the jump button is being held down on mobile should work perfectly, but, just in case your end goal from this is to prevent players from being able to hold down the jump button regardless of the input type (so that they have to manually press the jump button every time they want to jump) I wanted to share this solution I came up with a while ago to help save some time:

You could probably even modify it to utilize @DataSigh 's suggestion if you prefer that implementation of it.