Homemade wings won't work on touchscreen devices

Not sure how to class this issue as it isn’t really an Engine bug, more of a Roblox Gear bug.

  • Describe the bug. Describe what is happening when the bug occurs. Describe what you would normally expect to occur.

I give players the Homemade Wings - Roblox in my game as a prize after they finish the final stage and rejoins my obby; Boat Obby!!! - Roblox

  • 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?

1 Like

A lot of gears are broken with mobile, R15, Xbox, etc. The best thing to do would be to remake the gear if you need it working.

Perhaps its not working with Filtering Enabled. I think @Maximum_ADHD can give the best feedback on what should be done.

2 Likes

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.

3 Likes

I was just hoping there was an easy (read; lazy!) fix for gear that’s already in the Roblox inventory.

Yeah, it listens for the space bar input. I’ll give it a try! Thx CloneTrooper1019!

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)

Ugh, yeah. The code Luckymaxer used to write for gears is insane.

I’m not sure if there’s an easy way to fix this without refactoring a lot of the code. It probably wouldn’t be very compatible on mobile anyway.

Crud.
Any newer wings that work with mobile?

I’ll take a look at this after I’m done with my classes for today.

I couldn’t look into it last night because it was already midnight and I had an early class this morning.

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.