So right now I have a tool that activates when clicked, however on mobile whenever I move with the joystick it activates the tool when I don’t want it to. What could be some solutions to this?
So it activates when they click anywhere on the screen? I think if you don’t want it to activate when you move with the joystick, you could try something like this:
game:GetService("UserInputService").InputBegan:Connect(function(input, processed)
if not processed and input.UserInputType == Enum.UserInputType.Touch then
--code for the tool
end
end)
This should work for when a player touches on their mobile device. Tell me if it does not work for you, good luck!
if you’re using userinputservice, there is robloxprocessedevent I guess. just wanted to say e.e
If you want the tool to be activated by another button on mobile, use ContextActionService.
On pc the tool no longer fires the remote event, i put a print after the if not processed
UIS.InputBegan:Connect(function(input, processed)
if not processed then
print("1")
end
Oh yes, that is because of user input type.Touch only works for touch screen devices. You instead need to have it work for MouseButton1/MouseButton2 as well. Read up on it here: UserInputService | Documentation - Roblox Creator Hub
Also, is it working how you want it on mobile now?
Quick question does MouseButton1 work with mobile as well?
for example a button has .MouseButton1Down, on all devices it will fire the event at a click. but I’m quite sure the InputObject.KeyCode will not return a Mouse Button on mobile
No, it does not. I was saying use touch and that.