Are custom mobile buttons possible?

I’m trying to make a custom mobile buttons for my shooter game, without using built-in functions like ContextActionServices and Gui Buttons. The reason why I’m not using Gui Buttons is because the camera can not be panned or moved when the player holds down the button, making players unable to aim while holding down the fire button with the same finger.

I’ve developed a custom mobile buttons, since all my mobile action buttons are in a circle shape, I measure all the buttons’ size and store it’s radius and it’s center. When a player taps the screen, it detects the button with the closest position without violating the radius constraint. It turns out that it works pretty well and buttons can be recognized accurately.
fd1ed76950db8c7d7a7f0ace4dd34659

However…

I’m encountering one last problem: How could I tell when the player releases the button? Multiple buttons can be pressed at the same time. And the player can release the button outside of the button. This is also one of the reason why I don’t want to use Gui Buttons, because MouseButton1Up will not fire if the button was released outside of the button.

Is there any solution to this? It feels like I have to abandon the entire prototype right here if I don’t find the solution here…

3 Likes

Does InputEnded for GuiObjects work for you? GuiObject | Roblox Creator Documentation

You can try using UserInputService. Instead of utilizing the Keypressed or what ever its called, make an event and fire it when the key is pressed.