I need help with Mobile Button

I have an Animated combat system which is key binded. However, I’d like to also make it mobile functional with mobile buttons. However, I don’t know how to do so. Can someone help?

very easy. If your already using ContextActionService for you bindings, then just have the 3rd argument of BindAction() be set to true. If you dont already use ContextActionService then make something like this:

local function handleinput(name, state, obj)
    if name == "fire" then
        if state == Enum.UserInputState.Begin then
            shootGun()
        end
    end
end

game:GetService("ContextActionService"):BindAction("fire", handleinput, true, Enum.KeyCode.E)

to set the image and position of the button, refer to this article:

1 Like