Search Unity

Input.Touches - Simple Gesture Solution

Discussion in 'Assets and Asset Store' started by Song_Tan, Apr 28, 2012.

  1. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I dont quite understand what you mean. Honestly I dont really understand what IL2CPP is all about but as far as I know it's some sort of compiler to be used in Unity5 for C#. If that's the case, then any C# script written for Unity should be supported automatically. There's no additional effort needed to support it.

    Fyi, InputTouches is just a bunch of C# scripts for Unity so anything that Unity support by default, it should work with it too.
     
  2. Bjacks14

    Bjacks14

    Joined:
    Mar 16, 2015
    Posts:
    17
    Is there an event that handles a press and hold? I tried using the charged touch event but after a few seconds the event ends. I assume this is the end of the charged touch? I want to perform an event while the user is continuously touching the screen. Drags only register when the finger is moved.
     
  3. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    You can keep on using charge event. Just change the ChargeMode in TapDetector to 'Clamp'. Then you can hold the press indefinitely.
     
  4. Bjacks14

    Bjacks14

    Joined:
    Mar 16, 2015
    Posts:
    17
    Ah, perfect! Thank you for the prompt reply :)
     
  5. wilmer_lin

    wilmer_lin

    Joined:
    Nov 7, 2014
    Posts:
    4
    Hi I have been using InputTouches for a while and it's quite awesome.

    My current iPhone/iPad app uses a two-fingered drag, with each finger controlling a separate action (the user drags two thumbs on screen, each sort of does something different). Is there a way to use the MFDragging events to access the individual positions of the fingers? I can get their positions using the onPinchE and onRotateE events but I am not sure what qualifies a dual-fingered pinch/rotate versus a multi-fingered drag.

    The DragInfo class only returns the average positions of all the touches, and I probably need the exact positions similar to what the PinchInfo and RotateInfo provide.
     
  6. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    From what I understand, you should be using onDraggingE event since each of the finger is doing each own input independently. onMFDraggingE is for when you put two finger on screen to do a single drag (both finger are moving parallel to each other). If you switch to onDraggingE, each DragInfo instance should give you just the information regarding that one particular finger, including the position. You will need to check "EnableMultiDrag" option in DragDetector or you will be limited to one drag instance at a time.

    To clarify things, onDraggingE is for 1 finger dragging but you can have multiple dragging event by multiple finger on screen at any given time. onMFDragging is for multiple fingers performing a single drag input, the fingers has to stay together and move in a similar direction. onPinchE is when there are two fingers on screen moving in the opposite direction around their center point. onRotateE is when there are two fingers on screen rotating around their center point.

    An alternative solution (a bit of hack), assuming that you are sure that there's only ever two fingers on screen when the drag happen is to read the touch position directly, by using Input.touches[0].position and Input.touches[1].position. The problem is you will have no way to tell which position belongs to which drag for sure.
     
  7. wilmer_lin

    wilmer_lin

    Joined:
    Nov 7, 2014
    Posts:
    4
    Thanks for the prompt reply and clarification. I probably will just use the Input.touches in Unity and just use your scripts as a guide and make something custom to keep track of the touches. Just rummaging through the DualFingerDetector and DragDetector scripts gave me some ideas. Thanks!
     
  8. SoftwareLogicAU

    SoftwareLogicAU

    Joined:
    Mar 30, 2014
    Posts:
    34
    Is there a way to only detect swipes in a specific area (zone) of the scene?
    Thanks.
     
  9. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Yes, it's pretty much similar to how you limited the swipe input to only certain area on the screen. See based on the where the area in the scene appear on the screen, you can map that area onto the screen and just accept the input if it lands on that screen area. The tricky bit I imagine would be find out where that input zone appears on the screen.

    If it's static, you can manually defined the position. Then you simply take the cursor position of the swipe, check if it's within the defined input area. Like this:
    Code (csharp):
    1. public float xMin;
    2. public float xMax;
    3. public float yMin;
    4. public float yMax;
    5.  
    6. void OnSwipe(SwipeInfo sw){
    7.    //if any of the startPoint or endPoint of the swipe is outside the defined area, terminate the function
    8.    if(sw.startPoint.x<xMin || sw.startPoint.x>xMax || sw.startPoint.y<yMin || sw.startPoint.y>yMax) return;
    9.    if(sw.endPoint.x<xMin || sw.endPoint.x>xMax || sw.endPoint.y<yMin || sw.endPoint.y>yMax) return;
    10.  
    11.    //the code for swipe
    12. }
    If it moves in runtime. I would suggest you to do a put a collider over the area and use raycast to determine if the swipe lands in that zone. Like so:
    Code (csharp):
    1. public Transform areaDefinedObj;
    2.  
    3. void OnSwipe(SwipeInfo sw){
    4.    RaycastHit hit;
    5.  
    6.    bool startPointHit=false;
    7.    Ray ray1 = Camera.main.ScreenPointToRay(sw.startPoint);
    8.    if(Physics.Raycast(ray1, out hit, Mathf.Infinity)){
    9.      if(hit.transform==areaDefinedObj) startPointHit=true;
    10.    }
    11.    if(!startPointHit) return;
    12.  
    13.    bool endPointHit=false;
    14.    Ray ray2 = Camera.main.ScreenPointToRay(sw.endPoint);
    15.    if(Physics.Raycast(ray2, out hit, Mathf.Infinity)){
    16.      if(hit.transform==areaDefinedObj) endPointHit=true;
    17.    }
    18.    if(!endPointHit) return;
    19.  
    20.    //the code for swipe
    21. }
     
  10. SoftwareLogicAU

    SoftwareLogicAU

    Joined:
    Mar 30, 2014
    Posts:
    34
    Great, thanks for the speedy reply.
     
  11. AozakiKyuuji

    AozakiKyuuji

    Joined:
    Sep 21, 2012
    Posts:
    15
    Hi songtan,

    something is wrong with my Drag. It's not always, but sometimes, while my game object is being dragged, suddenly it will shoot me with an error message
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. PluckGesture.OnDraggingStart (.DragInfo dragInfo) (at Assets/Scripts/PluckGesture.cs:81)
    3. IT_Gesture.DraggingStart (.DragInfo dragInfo) (at Assets/Plugins/InputTouches/IT_Gesture.cs:314)
    4. DragDetector+<MouseRoutine>c__Iterator1.MoveNext () (at Assets/Plugins/InputTouches/DragDetector.cs:140)
    5.  
    And then the object that is currently being dragged, stops moving and I can't drag other stuff anymore.

    Here's my code
    Code (CSharp):
    1.  
    2. PluckGesture.cs
    3.  
    4. void Awake ()
    5.     {
    6.         dragShr = gameObject.transform;
    7.     }
    8.  
    9. void OnDraggingStart(DragInfo dragInfo){
    10.         LayerMask masker = 1 << 5;
    11.         Ray ray = mainCamera.ScreenPointToRay(dragInfo.pos);
    12.         RaycastHit hit;
    13.         //use raycast at the cursor position to detect the object
    14.         if(Physics.Raycast(ray, out hit, Mathf.Infinity, ~masker)){
    15.             if (hit.collider)
    16.             {
    17.                 //if the drag started on dragObj1
    18.                 if(hit.collider.transform==dragShr ||
    19. hit.collider.transform==dragShr.FindChild("ShroomCollider").transform){
    20.                     //latch dragObj1 to the cursor, based on the index
    21.                     shroomOriPos = dragShr.transform.position;            // save ori pos
    22.                  
    23. p=mainCamera.ScreenToWorldPoint(new Vector3(0, dragInfo.pos.y, 0));
    24.                     Obj1ToCursor(dragInfo, 0);
    25.                     currentDragIndex0=dragInfo.index;
    26.                 }
    27.             }
    28.         }
    29.     }
    This is line 81
    Code (CSharp):
    1.                 if(hit.collider.transform==dragShr ||
    PluckGesture.cs is on the character game object, while IT_Gesture.cs and DragDetector is in the Gesture gameobject
     
    Last edited: Mar 25, 2015
  12. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I suspect the problem is with dragShr.FindChild("ShroomCollider").transform. You will get the null exception when FindChild() return null (means it cannot find any child transform named "ShroomCollider") and you try to get the transform of a null object. Thing is FindChild() should have return the transform, so you can just remove the .transform after that. This should eliminate the error.
     
  13. AozakiKyuuji

    AozakiKyuuji

    Joined:
    Sep 21, 2012
    Posts:
    15
    Thank you! A day's headache.... solve by a simple mistake... dammit
    Sorry for providing a problem that has nothing to do with Input.Touches. Thank you for answering too :D
     
  14. flyingaudio

    flyingaudio

    Joined:
    Dec 3, 2010
    Posts:
    98
    songtan, upgrading to v1.2 broke my code, because I use onTouchDownE and onTouchUpE.
    So, I changed my code to expect Touch instead of vector2, but that breaks my onMouse1DownE and ...UpE because I point to the same method for both of them.

    Code (CSharp):
    1.         IT_Gesture.onMouse1DownE += OnTouchDown;
    2.         IT_Gesture.onMouse1UpE += OnTouchUp;
    3.         IT_Gesture.onTouchDownE += OnTouchDown;
    4.         IT_Gesture.onTouchUpE += OnTouchUp;
    5.  
    Before I separate out the mouse and touch calls, I was wondering if you had any slick ideas?
     
  15. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    You can try something like this:
    Code (csharp):
    1.   void OnEnable(){
    2.      IT_Gesture.onMouse1DownE += OnCursorDown;
    3.      IT_Gesture.onMouse1UpE += OnCursorDown;
    4.      IT_Gesture.onTouchDownE += OnTouchDown;
    5.      IT_Gesture.onTouchUpE += OnTouchUp;
    6.    }
    7.  
    8.    void OnTouchDown(Touch touch){
    9.      OnCursorDown(touch.position);
    10.    }
    11.    void OnTouchUp(Touch touch){
    12.      OnCursorUp(touch.position);
    13.    }
    14.  
    15.    void OnCursorDown(Vector2 pos){
    16.      //your code here
    17.    }
    18.    void OnCursorUp(Vector2 pos){
    19.      //your code here
    20.    }
    Now both mouse and touch event should point towards OnCursorDown and OnCursorUp
     
  16. flyingaudio

    flyingaudio

    Joined:
    Dec 3, 2010
    Posts:
    98
    Thanks songtan, that is exactly what I have been doing since I left the message. It was so compact and slick before, so I was hoping for the old days. It is just hard to add extra code when it wasn't necessary before. It was nice when the mouse and touch could be treated the same. But, I am sure I will be glad to have the extra touch information when I need it.
     
  17. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Oh I forgot. You can actually switch the touch function to onTouchDownPosE and onTouchUpPosE, which would just gives you the position information of the touch instead of the full touch instance.
     
  18. flyingaudio

    flyingaudio

    Joined:
    Dec 3, 2010
    Posts:
    98
    Oh, there we go. Thanks for pointing it out. I see it in the change notes now. You may want to update your PDF, because you have onTouchPosDownE and onTouchPosUpE.
     
  19. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Thanks for pointing that out. I'll get to it.
     
  20. Agapes

    Agapes

    Joined:
    Jun 26, 2014
    Posts:
    1
    hi

    i met a issue that Input Touches makes EMPTY " Asset / Plugins / Editor / " folder.
    this happens when i move InputTouches folder excpet that folder.

    ex ) after move "Asset / Plugins / Editor / InputTouches " and " Asset / Plugins / InputTouches "
    to " Asset / hoge / " and there is not exist " Asset / Plugins / Editor / InputTouches " folder, suddnly make it .

    this issue happens oftenfrequently.

    is there any idea to fix this issue ?

    regards.
     
  21. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I'm not sure what happen there. I havent't done anything that would cause InputTouches to create any folder. And I'm fairly certain I've never encounter case where Unity automatically create own empty folder. Are you running other stuff that would cause that? I've just tested it on my end (on both Unity4.6 and Unity5) without any problem.

    At any rate, I would recommend against moving those folder/files. Moving the core InputTouches script out of Plugins folder will stop the script from working with java script. Moving the editors script out of the editors folder will break the custom editor on InputTouches prefab.
     
  22. BerkeleyLHS

    BerkeleyLHS

    Joined:
    Jan 30, 2014
    Posts:
    6
    Has anyone seen any odd behavior on an iPhone 6 Plus? We seem to be getting multiple (appears to be 2) touch events when the screen is touched once. We're trying to track the problem down now, and thought it was worth checking if anyone saw a similar issue who is using the Input.Touches library. Songtan, have you tested the library with an iPhone 6 Plus? Many thanks in advance!
     
  23. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I have to say I haven't tested on iPhone6 plus or latest iOS for that matter. Which touch event you are using exactly? The only explanation I can think off is that you are having two InputTouches prefab in the scene.

    I do found something that could be related to your issue but it should have been fixed, depend on the version of Unity you are using. Please refer to this link.
     
  24. BerkeleyLHS

    BerkeleyLHS

    Joined:
    Jan 30, 2014
    Posts:
    6
    I'm using Unity 4.6.2f1, and trying to use the onTouchDownE and onTouchUpE events. When I touch the screen of an iPhone 6 plus (doesn't happen on any other devices), I get two touchdown events. When I remove my finger I get two touchup events. From watching in the Unity debugger, there is only one instance of the Gesture object (instantiated from the prefab). Weirdest part is that it works fine on iPad (retina and non-retina), iPod touch, iPhone 4, iPhone 5, and iPhone 6. The trouble only occurs with the iPhone 6 Plus. Very odd.

    I'll check out the link. Thanks!
     
  25. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Looking at the link, the version of Unity you are using right now could be the issue. It could well be a bug with Unity. I would suggest you to try with Unity4.6.3.
     
  26. BerkeleyLHS

    BerkeleyLHS

    Joined:
    Jan 30, 2014
    Posts:
    6
    Agreed. Looks like it might be a Unity issue. Moving to a newer version. I'll test and report back here (might not be for another day). Thanks for the link! Much appreciated.
     
  27. BerkeleyLHS

    BerkeleyLHS

    Joined:
    Jan 30, 2014
    Posts:
    6
    Building with the latest 4.6.2 patch seems to solve the issue. Thank you so much for helping us solve this!
     
  28. Kodoka

    Kodoka

    Joined:
    May 7, 2014
    Posts:
    1
    If I'm not mistaken the "MaxTapDisplacement" of the TapDetector is the maximum the cursor can be displaced from the the starting IT_Gesture.onTouchDown to the ending IT_Gesture.onTouchUp for the touch event to be considered a tap; however, even with setting the MaxTapDisplacement to 1 pixel, and doing very long swipes, I still get tap events. Does anyone else have experience with this? I need both the tap and swipe functionality, but for what I'm coding to work, I can't have tap events occur when what is actually happening is a swipe.
     
  29. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    You are right, any cursor movement beyond MaxTapDisplacement should void the tap event. But it seems to be working as it's intended on my end. I set it to 5 and I no longer get any tap event when swiping. Are you using the latest version? Have you change any of the code? You might also want to make sure you have only one TapDetector in the scene.

    If you are struggling and if you don't mind, you can send your project so I can take a look.
     
  30. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    I'm sorry if this question has come up already. I checked the docs and tried a forum search but could not find an answer.

    Is there a recommended way to pause detection of mouse scrolling and swiping while displaying an in-game GUI?
     
  31. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    That very much depend on the implementation of your so call in game gui. What exactly are they, pause menu? What I would do would be create a boolean flag indicate the state of the menu. The flag is then set to true whenever the menu is on and false if otherwise. So in your swipe event call, you can check the flag before executing any code. If the flag is true, then do nothing, proceed if otherwise. Make sense?
     
  32. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    852
    Thanks for the suggestion.

    I was trying to use an approach where I would enable/disable the InputTouches game object and/or the "detector" components depending on my "pause" state. It was working in Editor and PC builds but not in mobile builds.

    Based on your advice, I've added an "IsPaused" check to the Update methods of my detector scripts. It's now working reliably on all the Build targets I've tested on.
     
  33. M-P-F

    M-P-F

    Joined:
    Apr 22, 2015
    Posts:
    12
    Hi songtan,

    I'm having a bit of a problem with InputTouches. I have a starting scene with some options, and a "play" button. When I press the play button, I load the actual game scene [ Application.LoadLevel("gamePlayScene") ], and in there I register some events, as per usual, with this:

    void OnEnable(){

    IT_Gesture.onDraggingE += OnDragging;
    IT_Gesture.onPinchE += OnPinch;
    IT_Gesture.onMultiTapE += OnMultiTap;

    IT_Gesture.onSwipeE += OnSwipe;

    IT_Gesture.onDraggingStartE += OnDragStart;
    IT_Gesture.onDraggingEndE += OnDragEnd;

    IT_Gesture.onLongTapE += OnLongTapStart;

    }

    The first time I load the scene, everything works perfectly. Then after a while, the user may exit to the "menu scene", again via [ Application.LoadLevel("gameMenuScene") ], modify some things and start a new game.

    The second time around, Pinch events don't seem to fire.

    I tried loading the example scenes included with InputTouches, and in the RTS Camera scene I can replicate my results, but only after having loaded my "gamePlayScene". If I just load the examples, it works even after returning to the menu.

    Do you have any idea what could cause this? Other events from IT_Gesture such as dragging work just fine. I can't replicate the problem on PC, but that may simply be because OnPinch is a bit of a hack on PC anyway (utilizing the mousewheel).

    Any help would be appreciated, including a pointer on how to start debugging, because I'm a bit stumped! Otherwise loving InputTouches, by the way.

    Edit: Building for Android, but will eventually be deploying on iOS and a few other platforms.
     
  34. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    The first thing that comes to mind, you subscribe to the event via OnEnable() when you load your scene, but have you unsubscribe after when you exit back to the main menu? In the examples, there's a OnDisable() counterpart to the OnEnable() to unsub to the event when the script instance is destroyed/disabled.

    Also, do you notice any error message in the log?
     
  35. M-P-F

    M-P-F

    Joined:
    Apr 22, 2015
    Posts:
    12
    Thanks for the quick reply. Yes, I have a matching set of subscription de-selectors in OnDisable, like so:


    void OnDisable(){
    IT_Gesture.onDraggingE -= OnDragging;
    IT_Gesture.onPinchE += OnPinch; //<--- should be -= not += since it's in disable. Stooooooopid!
    IT_Gesture.onMultiTapE -= OnMultiTap;

    IT_Gesture.onSwipeE -= OnSwipe;

    IT_Gesture.onDraggingStartE -= OnDragStart;
    IT_Gesture.onDraggingEndE -= OnDragEnd;

    IT_Gesture.onLongTapE -= OnLongTapStart;

    }

    ... and I just realized what the problem is, of course. I have no excuses, so all I can say is.... thanks for the quick reply, it was a really simple thing that for some reason I completely missed until you made me take a second look.

    upload_2015-4-22_12-52-12.png
     
  36. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    No problem. It's a mistake I made quite frequently myself thanks to copy and paste. :)
     
  37. bngames

    bngames

    Joined:
    Jul 3, 2012
    Posts:
    67
    Hi

    Does InputTouches work with iOS IL2CPP ?

     
  38. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    As far as I know, yes. Fyi, InputTouches doesn't use any external plugin. It's just a collection of scripts written within Unity itself. So it should work under any circumstances where unity would.
     
  39. AwesomeAppDev

    AwesomeAppDev

    Joined:
    Feb 6, 2014
    Posts:
    2
    Any test experiences and/or future plans of supporting this asset on Android and Windows Phone devices ?
     
  40. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    It's tested and working on Android. It should be too for Window Phone as far as I know. The thing is it didnt use any additional code other than the default Unity's. So it should be working on all touch device supported by Unity. Hope this answer your question.
     
  41. DCrosby

    DCrosby

    Joined:
    Jan 13, 2013
    Posts:
    86
    I' trying to integrate Input Touches, with GoogleCardboard https://github.com/googlesamples/ca...er/CardboardSDKForUnity.unitypackage?raw=true, to facilitate looking around to be both Gyroscope based, but also to swipe to change the current look position, so they're additive.

    Cardboard has a Side by side 3D, and a single view 2D Mode, and I'd like to support the 2D Mode for people who haven't purchased a cardboard but are still curious on what kind of experiences VR Brings.

    It's been quite the headache. And I'm wondering if you have any starting points for doing this. As I don't see any camera rotation implementations with swipe to turn.

    I could have sworn I saw what I needed when running the web demo in OrbitCam mode, but now looking back it must have been an optical illusion as the camera orbits around an object instead of the camera looking around from a single point.

    -DC
     
  42. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Well, it's not that difficult to do a simple swipe to rotate camera angle implementation. Something like this:
    Code (csharp):
    1.   public Transform cameraTransform; //assign camera's transform to this
    2.  
    3.    void OnDragging(DragInfo dragInfo){
    4.      float x=cameraTransform.rotation.eulerAngles.x;
    5.      float y=cameraTransform.rotation.eulerAngles.y;
    6.    
    7.      //make sure x is between -180 to 180 so we can clamp it propery later
    8.      if(x>180) x-=360;
    9.    
    10.      Quaternion rotationY=Quaternion.Euler(0, y, 0)*Quaternion.Euler(0, dragInfo.delta.x, 0);
    11.      Quaternion rotationX=Quaternion.Euler(Mathf.Clamp(x+dragInfo.delta.y, -80, 80), 0, 0);
    12.    
    13.      cameraTransform.rotation=rotationY*rotationX;
    14.    }
    Keep in mind that this is very simple so it might not work very well. You will have to modify it yourself to fit your exact implementation.
     
  43. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    Hi,

    I can't make it work with Playmaker; can you give some hints ? What is the 'action' i should be looking for ?
    I dropped the 'PlaymakerInputeTouchesProxy' prefab; but then I get a null reference :

    Thanks !
     
    Last edited: May 26, 2015
  44. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I'm very sorry but afraid I wont be much help here. I don't use PlayMaker myself and have no idea how to use it in the first place. The integration of both packages is done by the dev of PlayMaker. I myself dont have the PlayMaker or the source code to start with. You will have to direct your question on the PlayMaker support forum.

    Very sorry for the inconvenience.
     
  45. cranecam

    cranecam

    Joined:
    Nov 25, 2013
    Posts:
    25
    hi,
    is there any sample showing how to use this library with orthographic camera movement?(i.e swipe /drag to move camera, pinch zoom etc)
     
  46. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Of course. In the webdemo there's a scene RTSCam which does exactly that. You drag/swipe with one finger to rotate the camera around, drag with 2 fingers to move the camera position, pinch/un-pinch to zoom in/out.

    The demo is included in the package with fully commented source code.
     
  47. bfarina

    bfarina

    Joined:
    Mar 21, 2014
    Posts:
    6
    Hello,
    I feel like I must be doing something horribly wrong because I can't for the life of me get multi tapping to work on my iphone running it through unity remote. It's not just that, clicking on menus doesnt work and the demos in general dont work as they should. Could this be something to do with the device's resolution or something? I am really running out of ideas, everything works perfectly when running it from my pc.
     
  48. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Sorry for the slow respond. I'm currently away from office.

    The issue could be with the value of MaxTapDisplacement on TapDetector. On a device with relatively high dpi (iphone being one), the cursor displacement on a singer finger tap could easily exceed the default value. I would suggest you to change it to something like 50-100.

    Can you please explain what are the menu you refer to? The menu in the demo? Or your own? What are they based on, 3rd party GUI solution, scripted OnGUI()?
     
  49. bfarina

    bfarina

    Joined:
    Mar 21, 2014
    Posts:
    6
    I thought that was quite a quick reply! I appreciate that.

    I've tried playing with the MaxTapDisplacement to no avail. Basically in the TapMenu from the demoscenes everything but the Double tap works, and the 'Back To Menu' button but thats the same on the PC. Instructions can be turned on and off.

    The menu that doesnt work at all for me is from the Menu Scene file.
     
  50. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I fail to see how double tap doesn't work while other tap event works? Have you tried a complete build on your phone rather than using UnityRemote? It's not the most reliable testing device in my opinion.

    Sounds to me that the just GUI button that do the scene change are not working. Could it be that you haven't add those scene to the BuildSetting? Do you get any error message in the log?