How often does the bug happen: Every time a player using a touchscreen device plays the game and they’ve got the wings they cannot activate them. They can select the wings from their backpack and they will be Enabled, but double jumping won’t activate the flying section of the script. Keyboard input users have no issues selecting and using the wings in the game.
Was wondering if it has something to do with the LocalScript that activates the wings after the player selects them from their backpack having a JumpTime set at 0.25 and the input from a touchscreen device not allowing that to work?
I’m not familiar with how this specific gear works, but I assume that it’s just listening to the space bar directly instead of reacting from the Humanoid’s jump action, hence why mobile devices aren’t able to trigger it.
There’s a relatively obscure event under the UserInputService called JumpRequest, which fires on the client whenever the user makes a request to jump using the standard input schemes. If you listen to this instead, it might work on mobile.
Sorry for my ignorance, but here is the section of script that uses the space bar input to jump. I tried using ‘local Key = game:GetService(“UserInputService”).JumpRequest’ instead of the 2nd and 3rd lines and changed the 4th line to ‘if Key and not Debounce then’ but that just made any double key input make you start flying as well as any key input make you stop flying.
Mouse.KeyDown:connect(function(Key)
local Key = string.lower(Key)
local ByteKey = string.byte(Key)
if ByteKey == string.byte(" ") and not Debounce then
if Flying then
StopFlying()
elseif not Flying then
if (tick() - Jumping.JumpTick) <= Jumping.JumpTime or Jumping.JumpTick == 0 then
Jumping.JumpTick = tick()
Jumping.Jumps = Jumping.Jumps + 1
if Jumping.Jumps >= Jumping.JumpsRequired then
Debounce = true
Jumping.JumpTick = 0
Jumping.Jumps = 0
BodyPosition.position = Torso.Position
BodyPosition.maxForce = Vector3.new(math.huge, math.huge, math.huge)
InvokeServer("CreateEffects")
Debounce = false
end
else
Jumping.JumpTick = tick()
Jumping.Jumps = 1
end
end
end
for i, v in pairs(Controls) do
for ii, vv in pairs(v.Keys) do
v.Number = ((((string.lower(type(vv)) == string.lower("String") and Key == string.lower(vv)) or (string.lower(type(vv)) == string.lower("Number") and ByteKey == vv)) and v.Numbers.On) or v.Number)
end
end
end)
Appreciate it!
Absolutely no hurry though, it’s not like it’s breaking anything.
I saw posts about FilteringEnabled breaking gear, but didn’t really see anything about touchscreen controls not working with gear.
With my limited knowledge of scripting I understood the basics of what it was doing fairly easily but it took me a while to figure out how that script was doing what it does.