How to Ignore Second Touch Input on Mobile?

I have a script that aims the character towards their mouse, it works fine on PC, but there’s a problem for mobile.

I use a body gyro and mouse.hit.p to get the mouse/finger position, but if you’re using a second finger/the finger you’re using for the joystick, the character will jitter back and fourth between the finger positions and I only want it to focus on the initial finger, if you get what I mean.

An example of what I want is similar to Blox Fruits. When you initiate a skill, the character will only follow the finger the initiated the attack and will completely ignore any other inputs

Happy to provide more information if needed

You could have it so that if the script finds a drastically different output to the previous, it ignores it. Not sure how well it would work but it might be worth a shot.

use userinputservice.touchtap it returns a table of positions that the fingers pressed im pretty sure

But I constantly need the position of the finger that started the attack. When I hold 2 fingers on the screen, one for the joystick and one for just aiming the attack, they like overlap each other and my character starts jittering back and forth.

you could hook UIS.TouchMoved to when your attack begins instead maybe that will help?

1 Like