I’ve created a mobile controls creator module that lets you make mobile controls, it was designed to make mobile compatibility easier by fixing common issues, input_src offers events similar to UIS except it’s made for touch screens only but doesn’t have inputObject returned
it doesn’t only offer controls for just a fix but also contains “value set” that allows you to edit how it should behave, along with theme customization for each control type
EXAMPLE
INSTALLATION
You can only get this from my GitHub repository here or if you’re not familiar with the GitHub then click on “Releases” or go to this page here, after downloaded the module, insert it into the place where client can access and you can finally begin scripting
it’s preferred that you should have controls as variable to be accessible across the scope, otherwise editing it seems impossible
local replicatclient = game:GetService("ReplicatedStorage")
local input_src = require(replicatclient.input_src)
local ref_joy = input_src.Joystick.create(screen_gui_path, zone_path, UDim2.fromScale(0.7, 0.7), 1) --screen gui path means the ScreenGUI you want to store and zone path as optional
ref_joy.joystick_settings.image_enabled = true
ref_joy.joystick_settings.dot_size = 1.7
ref_joy:update_preference()
ref_joy.joystick_inputbegin:Connect(function()
-- code
end)
ref_joy.joystick_inputend:Connect(function()
-- code
end)
CREDITS
tnavarts - for Signal module
HowManySmall - for Janitor module (cleanup tool)
ReelPlum - for SnapToBorder module (borrowed from his minimap)
NOTES BEFORE END
documents on my GitHub repository page is not finished as it does not contain some APIs, and because of how the code is structured, you might’ve seen some of the unused lines or impractical practice of coding, i do not consider myself as the best so keep this in mind before editing source code of mine or read to modify.