How do I detect how many fingers are currently on mobile devices?

I just want to detect how many fingers are currently on a mobile devices.

USER_INPUT_SERVICE.TouchStarted:Connect(function()
	fingers = fingers + 1
end)

USER_INPUT_SERVICE.TouchEnded:Connect(function()
	fingers = fingers - 1
end)

What I’m currently trying to code here is an Over-The-Shoulder Camera System for mobile, detects when player has 1 finger in the screen and is moving (probably moving around).

 if isOnMobile == true then
	if (fingers == 1 and LOCAL_PLAYER.Character.Humanoid.MoveDirection ~= Vector3.new()) or fingers > 1 then
		mouseDelta = mobileDelta * 20
	else
		mouseDelta = Vector2.new(0,0)
	end
end

I do not understand why this doesn’t seem to work, one thing I’ve noticed is that when I tried to input a “Kick” code to TouchStarted Event. It takes hours for that script to disappear in mobile even though there’s no one playing the game. I’ve tried adding a GUI that would tell that the game updated but it does seem to update but not the script, it still keeps kicking me until some hours past.

I tested mobile emulator from Roblox Studio and it does seem to work fine but when I played it in real mobile, when I try to move, the camera is still moving along with the joystick in mobile.

If there is any better way to detect fingers touching the mobile’s screen, please comment down below and I’ll try to come up with the solution.

I used this open-sourced OTS Camera System for my game: Over-The-Shoulder Camera System

2 Likes

I’m sorry for bumping this question, but did you find any solutions to your issue?