How to disable default mobile controls but not disable touch buttons created by ContextActionService?

Hello, I am trying to, as the title says, disable the default mobile controls (jump button, joystick) but not disable the buttons that are created by binding actions through ContextActionService.

I’ve tried setting GuiService’s TouchControlsEnabled = false and UserInputService’s ModalEnabled = true, yet both methods, understandably, disable the buttons. Any confirmation that this is impossible or alternative solutions are greatly appreciated.

2 Likes

When you’re playtesting inside Roblox Studio, look for the players ScreenGuis, there should be a specific one for mobile.

Check under that ScreenGui to see if you can disable/enable any default buttons.

If you don’t see any mobile related screengui, make sure you’re on a mobile device inside Roblox studio.

You could then set up a local script to make any changes.

1 Like

local UIS = game:GetService("UserInputService")
local PlayerGui = game.Players.LocalPlayer.PlayerGui

if UIS.TouchEnabled and not UIS.MouseEnabled then
	if PlayerGui:FindFirstChild("TouchGui") then
		PlayerGui.TouchGui:Destroy()
	end
end

“This is a LocalScript in StarterCharacterScripts.”
image

2 Likes

I wasn’t aware that the controls are just GUI elements, figured they would be more abstracted/obfuscated. Wish I could mark both posts as solutions, as this was quite insightful. Thank you for the information, cheers!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.