Clean Disable on Mobile Jump

Is there a clean and conventional way to disable the jump button on mobile users?

1 Like

If you don’t want them to be able to jump at all, you can set the HumanoidStateType for Jumping to false using Humanoid:SetStateEnabled. This should be done locally, and makes the jump button disappear as well.

For example, you could put a LocalScript in StarterCharacterScripts that does the following:

local character = game:GetService("Players").LocalPlayer.Character -- or script.Parent works too I guess
local humanoid = character:WaitForChild("Humanoid")

humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
6 Likes

I just want the jump button to dissappear.

4 Likes

You could probably just delete the jump button entirely or if you wanted to just hide the jump button you can set the button’s Transparency to 1 or use ModalEnabled, but i believe this hides all controls instead of just the Mobile Jump Button.

(there has been reported problems of it not working so this should help with that:
Can't Figure Out How to Use Modal Enabled - #2 by colbert2677)

If you wondering where the Jump button is, it’s Player > PlayerGui > TouchGui > TouchControlFrame > JumpButton

Here’s a resource:

Hope this helps, Have a Great Day/Night!

2 Likes

Make a local script inside the StarterGui, and type this.

local player = script.Parent.Parent
local character = player.Character
local humanoid = character:WaitForChild("Humanoid")

humanoid.JumpPower = 0

Now the Jump button will automatically be removed, this will also disable jumping on PC as well.

1 Like

You can also just remove it from the player gui in a localscript in StarterGui

local players = game:GetService('Players')

if players.LocalPlayer:WaitForChild('PlayerGui'):FindFirstChild('TouchGui') then
 players.LocalPlayer:WaitForChild('PlayerGui').TouchGui.TouchControlFrame.JumpButton:Destroy()
end
18 Likes