How to make a script that checks if you are on mobile

How to make a script that checks if you are on mobile

Maybe KeyboardEnabled can help you.
More help:

Just to emphasize here, checking for a particular platform for the purposes of UI / input events is a trap and nobody should be doing this.

You should dynamically update UI to fit whatever last input mode the user is using, and you should hook up input events to all possible input modes at once. This provides the most responsive experience for a user when they switch between keyboard/gamepad/touch/etc. (some devices have all of these modes)

1 Like

I know, I only answered what @jjadtru asked, maybe he wanted to make his own moves and needed to add something to mobile devices, how to place buttons for keys or events.

sir this is completely false and incorrect information

2 Likes

You are checking if the service is true…this makes no sense. Do you think if that there will be no userInputService if the player is on mobile due to the fact that mobile players cannot press keys?

1 Like