JumpRequest doesn't seem to work on mobile

I’m currently working on a dash\jump mechanic and I’m trying to make it mobile compatible. The first iteration of this system relied partially on JumpRequest, InputBegan on the GUI jump button for mobile and UserInputService. That system suddenly stopped working, and I couldn’t figure out why since it worked just fine until a few days ago & it displayed no errors.

I checked the Wiki, and figured that maybe it was a good idea to rewrite the code so that it relied exclusively on JumpRequest instead of repeating snippets of code to replicate the same functionalities on desktop and mobile, which is what I did.

This is the code (local script ofc)

local function onJumpRequest()
	print("aye why this isn't firing on mobile lol")
	if not Character or Humanoid:GetState() == HST.Dead then return end
	if jumpDB then return end
	jumpDB = true
	
	--Vertical Dash
	if jumpData.hasDoubleJumped then 
		Humanoid.JumpPower = jumpData.oldPower * jumpData.Multiplier + jumpData.flatMult
		Humanoid:ChangeState(Enum.HumanoidStateType.Jumping)
	end
	
	--Double Jump
	if jumpData.canJumpAgain and jumpData.Jumps < jumpData.MaxJumps and not Movement:GetAttribute("isSprinting") and not jumpData.hasDoubleJumped then
		Humanoid.JumpPower = jumpData.oldPower * jumpData.Multiplier
		jumpAnimation()
		Humanoid:ChangeState(HST.Jumping)
		jumpData.hasDoubleJumped = true
		movementRemote:FireServer("doubleJump",jumpData.hasDoubleJumped)
	end

	Service.RunS.Heartbeat:Wait()
end

--HumanoidStates--
Humanoid.StateChanged:Connect(function(oldState,newState) --Double Jump & Gliding
	if HST.Landed == newState then
		jumpData.Jumps = 0
		jumpData.canJumpAgain = false
		Humanoid.JumpPower = jumpData.oldPower

		jumpData.hasDoubleJumped = false
		jumpDB = false

		if Movement:GetAttribute("hasDoubleJump") then
			movementRemote:FireServer("Landed",jumpData.hasDoubleJumped)
		end

	elseif HST.Freefall == newState then
		
		task.wait(jumpData.TimeBetweenJumps)
		jumpData.canJumpAgain = true
		jumpDB = false
	elseif HST.Jumping == newState then
		jumpData.canJumpAgain = false
		jumpData.Jumps += 1
		jumpDB = true
	end
end)

Service.UIS.JumpRequest:Connect(onJumpRequest)

(My system has two different types of jumps, Double Jumps and Vertical Dashes. The dashes are supposed to be counted since there is a limit of dashes that can be executed by the player, but it’s irrilevant to the issue atm)

The code above works fine on desktop, but not on mobile. It doesn’t fire whatsoever and I’m starting to assume this is a problem on ROBLOX’s part since according to the Wiki, JumpRequest should also works on mobile. To prove this, I found two more threads that seem to share my same issue:

@DEVLocalPlayer did you ever figure out a fix for this?

Mb that is because the jump button on mobile is context action service and it is not InputUserService?
(btw i am not sure about it, it’s just an assumption) Also there is an option of checking humanoid state and then run your script if it’s state equals Enum.HumanoidStateType.Jumping.

Hi, that post is very old and I never continued that game, although I remember I used a workaround as I couldn’t figure out how to make JumpRequest work. Basically I set JumpPower to 0 so the jump button would hide, made my own jump button and positioned exactly over the Roblox jump button, then used the Velocity property of the HumanoidRootPart to simulate a jump once my custom button was being pressed. Once the double jump ended I just set the JumpPower back to its default number and the Roblox jump button reappeared, while I hid my custom double jump one.
It’s a shame they never fixed it (if it was ever actually bugged) as it could have a whole lotta uses.

PS. If you’re gonna do this I recommend using AssemblyLinearVelocity as Velocity was deprecated.

You can always hook functions to the events of the mobile jump button directly (it is a member of a player’s ‘PlayerGui’ folder).

It has to work as long as it’s in a LocalScript and there are no errors in the output. I once had a similar issue, where I tried every option and it still wouldn’t work, and this went for a full day until I realized you have to hold the jump button on mobile. So maybe try and see if it works?

Also, what is Service.UIS? Shouldnt it be game:GetService("UserInputService") ?