Mobile Compatibility

I’m working on a remake of Rocket Arena, and I have a jetboot. The jetboot works by holding your screen, and then jumping to fly.

The problem is that this doesn’t work on mobile. It doesn’t register your tap, and when you jump, it just jumps without flying.

So far, I’ve tried making a function that detects if you tap the button, and if you jump. I nested the jump detector inside the tap detector, but that only creates more problems. I searched the internet for fixes, but none of them worked, ending with an error that said that something isn’t a property of another thing.

My code to detect if both the jump or tap happened (either jump or tap first) is right here:

if userinputservice.TouchEnabled and not userinputservice.KeyboardEnabled and not userinputservice.MouseEnabled then
	print("Player is on mobile. Adding jetboot function to work.")
	Enum.UserInputType.Touch:Connect(function()
		userinputservice.JumpRequest:Connect(function()
			print("player jumped")
			
		end)
	end)
end

Hey!

If your still having troubles, feel free to try this out! If it doesnt fit your needs, just reply and give more detail please. Otherwises here you go!

local userinputservice = game:GetService("UserInputService")

userinputservice.InputBegan:Connect(function(input,gamepro)
	if gamepro then return end
	if input.UserInputType == Enum.UserInputType.Touch then
		print("Player is on mobile. Adding jetboot function to work.")
		userinputservice.JumpRequest:Connect(function()
			print("player jumped")
		end)
	end
end)

thank you! this worked very well!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.