How can i make this gun system for mobile

hey so i made a funcional gun system and my friend asked if he can use it for his game, and also asked me if i could make it work on mobile, making a fire button for mobile users, im only a beginer scripter and i dont have a clue on how to do that,

the main thing i need to know is how i can set up something that detects that a player is on a mobile device and puts a gui element on there screen,
if you have any advice for this or find a helpfull article on how to do this then that would be apreciated, since i cant find anything like that that can help

1 Like

I would look into using the ContextActionService. It allows you to add a button on screen for mobile users and overall makes keybindings like this a lot easier to manage across multiple devices.

Basically when the player equips the gun you use BindAction to set a function to trigger when the tuple of keybinds listed are pressed. You can also set a bool to create a on screen button for mobile devices.

4 Likes

In addition to this both alvinblox and thedevking have tutorials on this too. I hope this helped.

2 Likes

thanks, this is what i was looking for

1 Like

thanks for telling me this, it will be relay helpfull

2 Likes