Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I Change the UI Depending on the Player's Platform?

Asked by
Sulu710 142
5 years ago

I added several GUI buttons on the bottom right of the screen that will open different menus or activate different things. I want to add little keyboard letters next to each button, and pressing the keys on the keyboard would activate those buttons. This works perfectly fine on a pc, but its irrelevant on touchscreen and console devices. So my question is how do I change the scripts/GUI's depending on the player's platform? Because on console, it would be different inputs, and on touchscreen, it would just be tapping the buttons. So is there any way to detect the platform of a player or make my game more cross-platform friendly? Thank you for reading!

1 answer

Log in to vote
1
Answered by
compUcomp 417 Moderation Voter
5 years ago

Check UserInputService.KeyboardEnabled. If the client can't use the keyboard, hide the shortcuts.

0
Thank you so much, this will help a ton! :D Sulu710 142 — 5y
0
Glad I could help :) compUcomp 417 — 5y
Ad

Answer this question