Hey, how do I differentiate from what mobile button has been fired.
Currently I have one function that and within the function are if statements so for example
local function Fire()
if Input == Enum.UserInputType.MouseButton1 or Input == Enum.UserInputType.Touch then
print("Fist punch")
end
if Input == Enum.UserInputType.MouseButton2 or Input == Enum.UserInputType.Touch then
print("Heavy fist punch")
end
end
Notice how the first if statement I can differentiate between mouse 1 and mouse 2, but there’s a problem for mobile since it both has .Touch, but I need to make it so if button2 on mobile is pressed it does Heavy fist punch, but button1 does fist punch.
I dont know if this is wrong or not, but I do this, check if the player is pc or mobile, then from there create different behaviour on their client/buttons/triggers… (need feedback)
local UserInputService = game:GetService("UserInputService")
if UserInputService.TouchEnabled and not UserInputService.KeyboardEnabled and not UserInputService.MouseEnabled then
warn("MOBILE USER")
elseif not UserInputService.TouchEnabled and UserInputService.KeyboardEnabled and UserInputService.MouseEnabled then
warn("PC USER")
end
there’s no mousebutton 1/2 on mobile (ofc), i think you can to do is the MouseButton1 the corresponding input is Touch and the MouseButton2 is TouchLongPress…