Check if mobile player is using thumbstick?

Currently, I’m working on a gun system and I was trying to add mobile support for it, however, when I was testing it the player kept shooting at the position of my thumbstick when I was walking, I tried to fix this with GameProcessedEvent, however, it didn’t work. Is there a way to fix this without removing the player’s ability to shoot while walking?

Are you looking for thumbstick specifically? Or touch screen mobile/tablet in general?

The closest (as far as I am aware) can be achieved with

local userInputSvc = game:GetService("UserInputService")
local isMouse = userInputSvc.MouseEnabled
local isTouch = userInputSvc.TouchEnabled

if isTouch == true and isMouse == false then -- Make sure to check both as if you only check touch, it may include laptops with touchscreens too.
    -- Run whatever code is needed, this will work for mobile/tablet
end

Sorry if that’s not what you’re looking for.

This is a huge problem with mobile devices and if you play roblox on mobile, then you can see that a gun will shoot where your thumb is if you are using the thumb stick.

Unfortunately, I don’t think there is a fix for this. There might be, but I don’t think that there is. The best way to fix this is probably to add a shoot button that will shoot where a cursor that you make is. If you don’t understand what I’m trying to say here, you can play arsenal and see that they have a shoot button GUI and a cursor where the gun would shoot, which prevents mobile players from having the problem you’re describing.

Once again, I’m not sure if there is a direct fix for this, but if there is, someone please correct me.

5 Likes

Yeah, probably there’s no way to fix this as I was searthing for hours and didn’t find anything, thanks for the suggestion I will try it.