Reported in 0.3.7k, and confirmed. Multiple touches trigger buttons incorrectly.
Likely a bug with my internal fingerId tracking, not resetting the fingerId when a button is no longer held, resulting in the fingerId persisting and being checked later on.
Unity's fingerId is typically 0, and then incremented by 1 if needed, but ultimately tries to return to 0 again for new touches when possible. So, fingerIds get reused — not good if they are not reset properly.
[x] Rough steps to reproduce & fix:
Using one finger, tap to open the Weapon Selector, then let go.
Tap the screen to close the Weapon Selector.
Hold a movement arrow, then tap the Jump button — the Weapon Selector will appear.
[x] Other issue, involving Hold to Attack and Hold to Jump:
Hold a movement arrow to move.
Hold Attack or Jump.
Let go of the movement arrow – attack/jump stops working.
[x] Likewise:
Hold Attack or Jump.
Hold a movement arrow.
Let go of Attack or Jump – movement stops working.
[x] Fourth issue – happens when releasing a touch AND starting a new touch on the same frame (easiest to reproduce with low frame rate):
Hold jump button.
Release jump button, then hold a movement arrow – movement does not occur.
Reported in 0.3.7k, and confirmed. Multiple touches trigger buttons incorrectly.
Likely a bug with my internal
fingerId
tracking, not resetting thefingerId
when a button is no longer held, resulting in thefingerId
persisting and being checked later on.Unity's
fingerId
is typically0
, and then incremented by1
if needed, but ultimately tries to return to0
again for new touches when possible. So, fingerIds get reused — not good if they are not reset properly.