PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

ModalEnabled

UserInputService

bool

The ModalEnabled property toggles whether Roblox’s mobile controls are hidden on a player’s mobile device. The default value of this property is false. The controls are hidden when set to true, and not hidden when set to false.

This property can be used when you want to hide or display Roblox’s mobile controls for a player.

Even if mobile controls are hidden for a player on a mobile device, other UserInputService events such as UserInputService/InputBegan and UserInputService/TouchSwipe can still be used to process other forms of user input on mobile devices with an enabled touch screen (see the main UserInputService class page for a full list).

Since UserInputService only runs client-side, this property will only work when used in a LocalScript.

##See Also
The tutorial on disabling parts of the game interface, found here, provides excellent documentation on using this property.


Code Samples


UserInputService.ModalEnabled

This example toggles between hiding and showing the user’s Roblox mobile controls every 5 seconds.

local UserInputService = game:GetService("UserInputService")

while true do
	UserInputService.ModalEnabled = not UserInputService.ModalEnabled
	wait(5)
end