Mobile control buttons not appearimg

I’m currently in the process of making a game, and I have noticed that the jump button and joystick on mobile have completely disappeared, making the game unplayable on these devices. I do not have any script that enables ModalEnabled or something similar, all I have is a custom movement script that listens to the WASD controls.

ContextActionService:BindAction("Up", onUp, false, "w")
ContextActionService:BindAction("Left", onLeft, false, "a")
ContextActionService:BindAction("Down", onDown, false, "s")
ContextActionService:BindAction("Right", onRight, false, "d")
ContextActionService:BindAction("Jump", onJump, false, Enum.KeyCode.Space)
ContextActionService:BindAction("Crouch", onCrouch, false, "c")

Correct me if I’m wrong but, I believe this is because the BindAction() function will remove the default button linked with the action on mobile devices.

Edit:
Try setting the third parameter to true…

1 Like

I would consider double checking the Properties of the Gui’s that you have, just to make sure that they aren’t overlapping the default Mobile Controls

And I’m not sure if you notice this, but the Third Parameter of a BindAction method, is checking to see if you want a Mobile Button toggled on the screen for mobile devices

  • Parameter #1: Action Name (String)
  • Parameter #2: Action Function (function)
  • Parameter #3: Display a Bool Button? (boolean)
  • Parameter #4: A list of keybinds to assign (Variant of Keycodes)

@bonkybincer What…? BindAction will not remove the Mobile Controls, even if I tried to assign every single movable keybind with that

-- StarterPlayerScripts
local CAS = game:GetService("ContextActionService")

local function Yes()
	print("Bruh")
end

CAS:BindAction("Move", Yes, true, Enum.KeyCode.D, Enum.KeyCode.A, Enum.KeyCode.S, Enum.KeyCode.W, Enum.KeyCode.Space)
CAS:SetPosition("Move", UDim2.new(0.2, 0, 0, 0))
1 Like