Search Unity

Unity Remote Multitouch

Discussion in 'iOS and tvOS' started by sebas77, Nov 7, 2011.

  1. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,642
    Hi,

    do I have to enable something to work with the multitouch input when I use Unity Remote? Thank you.
     
    Last edited: Nov 7, 2011
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    No your code just has to make use of multiple touches
     
  3. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,642
    Thank you for the answer.

    I asked that because what I have is a normal behavior when I build an iOS app, but on Unity Remote instead, the code behaves like if it recognizes only one finger.
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    perhaps you have code that disables multitouch, you disabled it in the remote or you built it through OnGUI which by definition is not multitouch capable at all
     
  5. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,642
    Thank you again. How can I disable it in the remote? (sounds like the only plausible one)
     
  6. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    if you use the one from appstore you can't, so no worries there.
    in that case you would have disabled it in code or you just don't make use of Input.touches / Input.GetTouch in the right way
     
  7. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,642
    ok, last question, on AppStore I can find 2 version of Unity Remote, which one should I use?
     
  8. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Unity Remote 3

    the other one is for unity iphone 1.x which hopefully nobody is using any longer
     
  9. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,642
    Right, thank you very much then, it seems everything all right, I must have made a mistake somewhere.
     
  10. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,642
    Me again.

    I double checked the code, there is nothing special and I can confirm again that while the multi-touch works normally if I build the app and run it on the iPad 2, it does not work if I use the Unity Remote connecting it to a macmini running Snow Leopard Server.

    I do not know what is going on, but I do not see much space for a mistake in code, which behaves normally, since Input.multiTouchEnabled returns false!

    How can Unity Remote support the multiTouch if it is not even enabled?

    Using the remote would be really useful since tweaking the input settings is very time consuming when I have to deploy to the iPad.

    Thank you for your precious help.
     
  11. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    input.multitouchenabled likely returns the state of the device it runs on -> your mac

    keep in mind, NO code is execute on the remote, so also stuff like #if UNITY_IPHONE is failing in such a case for example.

    but its strange that it should not work with multitouch anymore as it worked from unity iphone 1.x until the last time I tested it on 3.3 or 3.4 on my itouch 3, itouch 4 and ipad1
     
  12. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,642
    yep, that is what I thought. So I removed all the UNITY_IPHONE defines, but still, multitouchenabled returns false, how is it supposed to work?

    Anyway, I made several tests and this is the result so far:

    multiTouchEnabled always returns false (which already does not make any sense and makes the Unity Remote useless)
    Input.TouchCount returns the correct value
    Touch.phase allegedly seems to return always stationary
    Touch.position seems to return alway 0
     
  13. Tochas

    Tochas

    Joined:
    Nov 24, 2012
    Posts:
    17
    Hi Sebas77,

    Did you found how to make Unity Remote 3 work with multitouches? I am experiencing the same issue here
     
  14. Mantas-Puida

    Mantas-Puida

    Joined:
    Nov 13, 2008
    Posts:
    1,864
    multiTouchEnabled does not work with remote, it's a known limitation.
    Touch.phase, Touch.position should work just fine, maybe it's a shaky WiFi connection?
     
  15. Tochas

    Tochas

    Joined:
    Nov 24, 2012
    Posts:
    17
    I debuged the code I am using and Input.touches[] at most only has one element
    while running the same application on the device works flawlesly
     
  16. iwHiteRabbiT

    iwHiteRabbiT

    Joined:
    Feb 15, 2011
    Posts:
    47
    Thanks Unity's staff and again, Dreamora, stop responding if you don't know "again" what you're talking about... It's a old post but you're still doing this ! You are very boring, and you keep wasting all people time... So please stop your annoying spam. Thanks
     
  17. _clewis_

    _clewis_

    Joined:
    Mar 16, 2014
    Posts:
    2
    I ran into this issue as well, and it turns out that it was an issue in TouchInputModule.UseFakeInput(). This function checks Input.touchSupported, which as of 5.0.1f3 always returns false in the editor. I make a copy of the file at https://bitbucket.org/Unity-Technologies/ui/src/cc791b3335d2d46b70d932fc70e6ec6c4ea6d561/UnityEngine.UI/EventSystem/InputModules/TouchInputModule.cs and modified UseFakeInput() to always return false. This seems to have fixed my issue for now. A better long-term solution would be for Input.touchSupported to return true when Unity Remote is connected.
     
    Nodrap and eelstork like this.
  18. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    LOL at this thread being necro'd to yell at @Dreamora for something he said 4 years ago.
     
    MD_Reptile likes this.
  19. Nergard

    Nergard

    Joined:
    Oct 20, 2015
    Posts:
    2
    @_clewis_ Can you please elaborate on your actions for fixing the multitouch issue? Did you just insert the file into your project? I am using a joystick plugin and I get the "The imported type `UnityEngine.EventSystems.TouchInputModule' is defined multiple times" error.