Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BeginTouch should make the touch Stationary the next frame if the touch was not ended or moved #1492

Open
RobertPoienar opened this issue Jan 31, 2024 · 1 comment
Labels
bug Something isn't working triaged
Milestone

Comments

@RobertPoienar
Copy link
Contributor

At the moment BeginTouch creates a touch and set the TouchPhase to Began. This should only for a frame because when the TouchPhase is set to began. When this happen Unity consider that the touch was created in the current frame and will return GetMouseButtonDown(0) true. This will happen every frame even if it supposed to happen just once.

We can fix this by checking the next frame if the touch has changed the phase from Began to Moved or Ended if this happen we don't need to do anything but otherwise we need to set it to Stationary

Steps to reproduce

  1. Create a test that calls BeginTouch()
  2. Check in the game what GetMouseButtonDown(0) return every frame

Actual result

AR

GetMouseButtonDown(0) returns true everytime

Additional info

Expected result

GetMouseButtonDown(0) returns true only once

ER

Additional info

Testability

@RobertPoienar RobertPoienar added the bug Something isn't working label Jan 31, 2024
@RobertPoienar
Copy link
Contributor Author

Triaged Week no. 5, 2024. Not prioritized for next releases.

@gomboskriszta15 gomboskriszta15 added this to the Input milestone Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triaged
Projects
None yet
Development

No branches or pull requests

2 participants