How can I detect when a certain finger on a touch screen is released

I’m making a wiring/connecting system for my logic game, but mobile support is a bit problematic since if they drag a wire to another block and lay another finger on the screen then release it, the connection process will end since it thinks the connecting finger was released. Any way to prevent this problem? I’m a bit weak at explaining so if you want, I’ll try to screen record my phone and post it here
Thank you in advance!

So the way Roblox InputService works is, everytime a finger starts / ends a connection with the screen it will fire the InputBegan or InputEnded signal, so if two fingers touch the screen the Signal should be fired twice. If this does not happen then it could be either a bug or an issue with the Player’s device (most of the time it will have something to do with the device not supporting multi-touch or just not doing a very good job at it)

2 Likes

You could have like a number variable

local fingersPressed = 0

and increase that number by fingersPressed += 1 everytime the screen is tapped and decrease it by -= 1 everytime the connection stops and if the fingersPressed reaches 0 do your release logic if not just return

2 Likes

Note: remember that input systems may have limits. The following article is for keyboards, but from my experience the same happens with touch screens.
This is relatively important because it might detect an input to end when another one begins, although it’s just that the limit’s been reached.

Follows the Wikipedia article:

2 Likes

Hey, this was originally the solution, but I found out that if you click and then move your cursor over a ui button and release, it would not detect that the mouse button/finger was released. Any way to fix this? Thanks. [edit: nvm, on the inputbegan and inputended I accidently made it return if it was gameprocessed]

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