Hi everyone, I want to support mobile users for my game, so I’m deciding to make a “fire” button to shoot a gun. Is there a way to bind the button to tool.Activated?
I’ve never really done this before, but the Dev Hub has something on it: Mobile | Roblox Creator Documentation
Not trying to be rude or anything, but if you didn’t search for your answer before you posted, I would suggest doing that next time.
I did, but I couldn’t find a way to make all my weapons mobile compatible without editing every script.
Well, if you have a function for Tool.Activated, you can call the same function for ContextActionService.ButtonPressed (I have no idea what the event for the mobile button being pressed is, as the DevHub is being really slow right now).
You could use ChildAdded
and ChildRemoved
to see when something is parented to the player’s character. If the new child is a tool, create the gui button and bind it to activate the tool. When the tool is removed, unbind the action and hide the gui, or delete it.