Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Unity 2022.2 is now available as the latest Tech release.
    Dismiss Notice
  3. We are making some changes to the DOTS forums.
    Dismiss Notice
  4. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Bug: too many touches.Began on WebGL

Discussion in 'WebGL' started by petrucio, Feb 25, 2016.

  1. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    I was implementing a touches wrapper to get around the lack of support for Input.simulateMouseWithTouches on WebGL, and it turns out that
    Code (csharp):
    1. Input.GetTouch(0).phase
    seems to return TouchPhase.Began every frame while the finger remains pressed.
     
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    If you could submit a bug report with a repro project, that would be much appreciated.
     
  3. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    @petrucio

    Did you submit a bug report about this? I think the bug still persists.
     
  4. petrucio

    petrucio

    Joined:
    Aug 30, 2011
    Posts:
    126
    Sorry, I don't remember if I did, but I think I never found the time to do it. And I don't remember how I got around this (but I did).
     
  5. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    I got around it by simply locking the touch with a bool. Incidentally, I also have no time to file a bug report. Oh well.
     
  6. djlastnight

    djlastnight

    Joined:
    Dec 10, 2020
    Posts:
    2
    I can't believe this bug is still present 5 years later.

    You do not need any repro project for something such obvious and easy to reproduce (just Debug.Log(touch.phase) at any update method body and track the logs at the browser console).

    It is easy to workaround, but it wasted too much precious time until I found UNITY has this bug.
    I always blame my own code first..

    Please fix this,
    Regards Ivan
     
    Last edited: Aug 21, 2021