How do you get a run button for pc and xbox and phone

Hello

I am stuck and wondering how do I detect what device the player is on (xbox,pc,phone) and add a custom control for that certain device. I am trying to add a run feature on pc it would double down w to activate. But i want to press down analog stick for xbox. What do i do?

Thank you

UserInputService.KeyboardEnabled and not UserInputService.TouchEnabled 
--pc
UserInputService.TouchEnabled and not UserInputService.KeyboardEnabled 
--mobile
2 Likes

For mobile

For Xbox
Hope it helped!

1 Like

Just connect a run button for all relevant input modes at once. This is most user-friendly and avoids issues when people switch input modes or have multiple input modes available.

@Creeperman16487 your solution is not appropriate, you shouldn’t assume input mode from these values. There are devices that fall between these categories and your game will be broken / bad UX for those devices.

1 Like