What I wanted to do is enhance gameplay by adjusting the GUI for mobile users. For example, on PC or Tablet, you will have the full GUI, but on Phone, you have to press a button so you get the full GUI, otherwise, the only thing on your screen is the button for the full GUI. (For example, in MeepCity.) I don’t want to have that on PC and Tablet. Can someone show me an example on how to do this?
You can't check if the user is on mobile, but there are workarounds.
You don't need to check if the player is on a phone to realize that phone's have small screens. You can use the camera's ViewportSize
property to identify the size of the screen you are working with, and when it's under a certain size, change the GUI to be the open/close menu GUI. This is better than checking if a device is a phone because you never know if someone likes to play with a really tiny window on PC, or someone has a extremely large device screen :p
Hope this helps! :)
An easy way to do this is by using the code below in a localscript
local uis = game:GetService("UserInputService") local ismobile = uis.TouchEnabled if ismobile then -- code end