Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Problem with Input.GetTouch(0) returns touch with wrong fingerId

Discussion in 'Scripting' started by pvk, Jan 23, 2013.

  1. pvk

    pvk

    Joined:
    Jul 18, 2012
    Posts:
    11
    Hi,

    I have problem using Input.GetTouch(0) returns touch with wrong fingerId,

    Input.touchCount gives the correct count, but the problem is with the fingerId.

    when I am in the game the fingerId is 0 ( on touching with single finger )

    once the game goes background ( by pressing home button or opening some url ) and coming back to the game

    on touching with single finger - fingerId is increased by one

    on keep doing the above steps the figerId is reached to 32

    Someone please help in fixing the problem. Is there a way to reset the touch fingerId

    waiting for the reply

    Thanks
    pvk
     
  2. bigmisterb

    bigmisterb

    Joined:
    Nov 6, 2010
    Posts:
    4,221
    I am afraid you are probably going to have to supply some script on this. Never rely on the finger id. If you are tracking touches, always track the current finger id.
     
  3. pvk

    pvk

    Joined:
    Jul 18, 2012
    Posts:
    11
    Hi bigmisterb,

    thanks for the reply

    i am not using the fingerid in the game,
    But there is bug saying, touch is not working in the game when it is goes background for 32 times ( by showing ads, moreapps or home screen )
    I just kept log to see what is happening

    foreach(Touch touch in Input.touches)
    Debug.Log("count = "+Input.touchCount+"touch id = "+touch.fingerId);


    count variable is returned properly but fingerid keep increasing after game going background.

    once the fingerid reaches 32 , nothing in the game is touchable.

    waiting for some solution
     
  4. pvk

    pvk

    Joined:
    Jul 18, 2012
    Posts:
    11
    Hi guys,

    I found the problem, It is unity3.5.7 bug and reported them today.
     
  5. Michael-ClockStone

    Michael-ClockStone

    Joined:
    Jan 18, 2012
    Posts:
    90
    I can confirm this bug, also happens in our Android app with Unity 3.5.7
     
  6. AlystairWesley

    AlystairWesley

    Joined:
    Feb 9, 2013
    Posts:
    1
    Any word on this getting fixed or updated? I'm having the same issue and it's causing a problem with UIToolkit.
     
  7. SpicyCatGames

    SpicyCatGames

    Joined:
    Sep 30, 2019
    Posts:
    14
    For anyone who sees this in the future, this is not a bug and is expected behavior.