Hello,
I have a script that toggles flight when you double press space, but this doesn't work on mobile because they don't jump with a space bar. What is their jump button called in UserInputService?
Thank you!
Hello,
I have a script that toggles flight when you double press space, but this doesn't work on mobile because they don't jump with a space bar. What is their jump button called in UserInputService?
Thank you!
Not sure this is a thing, but you could detect if they are not a computer and jump.
local UIS = game:GetService("UserInputService")
function JumpRequest()
if UIS.TouchEnabled and not UIS.KeyboardEnabled and not UIS.MouseEnabled then -- if a player uses a touch screen, no keyboard, and no mouse then
-- do stuff--
end
end
UIS.JumpRequest:Connect(JumpRequest)
More information:
https://developer.roblox.com/en-us/api-reference/property/UserInputService/TouchEnabled
https://developer.roblox.com/en-us/api-reference/property/UserInputService/KeyboardEnabled
https://developer.roblox.com/en-us/api-reference/property/UserInputService/MouseEnabled
https://developer.roblox.com/en-us/api-reference/event/UserInputService/JumpRequest
This discussion is preserved as it was. New answers, comments, and votes are closed.
6 comments
Error line 8; JumpRequest is not a proper function. Lol, lowercase j.
ahh, sorry!
ahh, sorry!
edited, lmao
This could work, thank you, but how do I check if they double jump?
That's not possible.