# Mobile Jump

## Getting Mobile Jump Button

You can get the mobile jump button with the following code. This will error if the UserInputService.TouchEnabled is false

```lua
local PlayerModule = require(Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerModule"))
PlayerModule:GetControls().touchJumpController.jumpButton
-- add some wait checks
```

***

## Hide Mobile Jump Button

Setting JumpHeight to 0 will not hide the mobile jump button.\
But Setting JumpPower to 0 will hide the mobile jump button.

```lua
-- Hide Mobile Jump Button
Humanoid.UseJumpPower = true
Humanoid.JumpPower = 0
```

## Mobile Jump Button default position/size

The TouchGui JumpButton that appears for mobile devices has 2 variants depending on this check:

```lua
local minAxis = math.min(parentFrame.AbsoluteSize.X, parentFrame.AbsoluteSize.Y)
local isSmallScreen = minAxis <= 500
```

(small screen)\
Button Position = UDim2.new(1, -95, 1, -90)\
Button Size: UDim2.fromOffset(70, 70)

(large screen)\
Button Position = UDim2.new(1, -170, 1, -210)\
Button Size = UDim2.fromOffset(120, 120)
