Trouble creating an automatic gun that can be used on mobile

I currently have automatic weapons that have tool.Activated events in a server script, but I realised this doesn’t work on mobile as holding your finger down on the screen activates camera movement. Is there any way to get around this with tool.Activated in a server script?

2 Likes

Tool.Activate only simulates mouse.Button1Down, and because the way mobile works, it does not support panning the camera (holding your finger down)
People have asked how to fix this before to no avail, but your best bet is probably to use a client script and use
UserInputService.TouchStarted
and
UserInputService.TouchEnded

You could also use ContextActionService, but making a button for a weapon would be a little weird to control.

Sorry if this disappointed you, but it’s probably best to use a client script to handle inputs for the lowest latency - just don’t forget you still need to spawn the bullets via the server.

2 Likes

Ah, I was afraid that would be the only solution. Thank you very much for the detailed response, I guess it would be best to just move it to a local script.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.