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
    Hi Lind,

    Thanks for letting me know.

    I'm not entirely sure if what happen with the drag in your app is really a bug. Seems to me that everything is working except there's a small delay or overshoot with the page movement. Therefore the respond to the drag seems to be a it laggy. This could be a bug or the code itself. I cant be sure until I see them. So can you let me know what code you are using? If possible, please email me the code.

    About the TapDemo scene however, something is definitely not right. Let me have a look and get back to you. Please understand that I could be a bit busy so there might be some delay. I'll get back to you asap.

    Song
     
  2. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Next time you look over the code of this asset, could I ask you to look into the following as well?

    When deploying to Android touch device, Unity warns:

    Game scripts or other custom code contains OnMouse_ event handlers. Presence of such handlers might impact performance on handheld devices

    Might be a good idea to put those handlers inside compiler #if directives such as:

    Code (csharp):
    1.  
    2. // one global compiler define
    3.  
    4. #define NOMOUSE = (UNITY_ANDROID || UNITY_IPHONE)  !UNITY_EDITOR
    5.  
    6. // later on near onMouseHandlers:
    7.  
    8. #if !NOMOUSE
    9.  
    10. // ... onMouse handlers go here...
    11.  
    12. #endif
    13.  
    Whatya think? :)
     
  3. Lindrae

    Lindrae

    Joined:
    Jun 13, 2013
    Posts:
    8
    Hi Song,

    Thanks for your quick reply, you are amazing!

    I will be sending you the code in a few hours because I don't have my working computer with me right now. If you had time to watch again my first video here is some more information in order to show you when the bug occurs exactly, because it is indeed not so obvious. By the way, the small delay you noticed is really fine with me : I don't expect the movement to be fluid AND to follow exactly the user finger! Moreover what could appear as lag could be the fact the camera movement is limited to the page size, thus dragging outside the boundaries has no effect.

    As for the video (link : https://docs.google.com/file/d/0B_9E...YyN0pBMUE/edit ), here are my comments with an approximate time code :

    - 0'03'' : First pinch --> zoom in
    - 0'04'' to 0'07'' : Drag -- > normal drag, everything is fine : the page and the finger are in sync.

    - 0'08" to 0'10" : Pinch --> zoom out and in
    - 0'10"" to 0'13'' : Drag --> Bug, ie the page moves more than the finger ( after the previous pinch, the dragging finger stayed on the screen to execute the drag)
    - 0'14" : Finger up
    - 0'15" to 0'19" : Drag --> normal drag (although I realize that small circular motion does not show the best of it... )

    - 0'20" to end : Repeating previous sequence from 0'08" to 0'19".

    Again, we found how to trigger the bug, but otherwise everything is working as it should.
    I hope this helps,
    -Lind
     
  4. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Thanks Lind, that's pretty useful info. I'll spend sometime tomorrow to look at the issue and get back to you.
     
  5. shadowfork

    shadowfork

    Joined:
    Jan 8, 2010
    Posts:
    167
    Does anyone know how I can make the OrbitCam scene rotate initially on start without the user dragging it?
     
    Last edited: Sep 23, 2013
  6. greenland

    greenland

    Joined:
    Oct 22, 2005
    Posts:
    205
    @songtan:
    I'm getting an unhanded OutOfRange exception on iOS, line 182 of TapDetector.

    http://hastebin.com/culebukaxa.pl

    Which for some reason, seems to stop rendering everything from mainCamera and it just goes black.

    I can reproduce it every time by giving more than one second of "random" touch input (aka: bashing the screen with ten fingers like a wild chimp, which is not the edge case it seems considering how frustratingly difficult my game is.)

    IRC speculation is: "some fingers are being released before others and it is decreasing the 'index' prematurely so the array size is smaller than it should be."

    But I'm stumped. Advise?

    @shadowfork:
    I've attempted the same thing by "spoofing" touch input... which is harder than I thought it would be. No success.
     
    Last edited: Sep 25, 2013
  7. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I've looked at the code, as well as do a quick test on my iPhone. Everything seems to be working well. Yes, I did tap on the screen with all my fingers franticly. Thing is, out of range exception at line182 seems a bit strange to me. The part of the code is pretty fault prove as far as I can tell. I suspect there is something else that cause the error. And a simple out of range exception shouldnt stop the camera rendering. I would suggest you to try to replicate the bug with the same Gesture prefab setting in other scene to see if it's faulty on its own.


    I'm not sure how you want to make the OrbitCam rotate, but you can simulate a drag event by using following code in OrbitCam.cs:
    Code (csharp):
    1.         DragInfo dInfo=new DragInfo(Vector2.zero, new Vector2(1000, 1000), 1);
    2.         OnDragging(dInfo);
    If you want to rotate it as soon as the scene start, just add that 2 lines of code in Start(). Feel free to modify the value of the second vector to change the rotation.
     
  8. greenland

    greenland

    Joined:
    Oct 22, 2005
    Posts:
    205
    I reproduced the bug by using only the provided OrbitCam demo scene on an otherwise new and empty Unity project. iPad Mini.



    It's much easier to reproduce with two hands, so in this video, it takes a few seconds of effort. I've also encountered the same bug (everything in main camera view disappears), with just a couple seconds of touching normally, but that's far more rare to occur.

    My game also makes use of a (modified) orbit cam script from the asset... perhaps it is the culprit?
    The fact that the script is attached to the camera, and it's the camera that seems to freak out would support this.
    It seems to be something more than simply facing the camera the wrong direction though, because in my game, even the skybox disappears.
     
    Last edited: Sep 25, 2013
  9. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I see, I thought the screen has gone completely blank. Tha would have been strange. Now this make more sense now. Give me some time, I'll try to figure out what have possibly gone wrong.
     
  10. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    @greenland, I think I've found the bug that cause the error. Please let me know your email so I can send you the fix.
     
  11. greenland

    greenland

    Joined:
    Oct 22, 2005
    Posts:
    205
    Outstanding. It seems to be fixed... that was fast.
     
  12. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Cool, hope the update will get pushed to Asset Store soon ;) ;)

    Also a cosmetic question, instead of a Plugins/InputTouches folder for your scripts, can you move the scripts into a Plugins folder inside your asset's main InputTouches folder? So instead of /Plugins/InputTouches/SomeScript.cs we'd have /InputTouches/Plugins/SomeScript.cs. This works just as well with regards to the special role a Plugins folder has, but allows for better asset organization. I put all 3rd-party deps in some sub-folder structure like Assets/_Deps/Scripts/InputTouches etc. Don't want too much at root level.

    Also bump:

     
  13. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I'll try. Tbh it's a very minor bug and only happen if you do use rotate and have your input works in in some specific ways. If you want an advance copy, please send me your email so I can send it to you.

    I've tried to place the Plugins folder within InputTouches folder. That doesnt work. It simply breaks the compilation order for js script. If you dont use js script, feel free to move the folder to anywhere you want. The only reason it's placed where it's is to accomodate js script.

    As for the onMouseHandler, please see this. I've tried remove all the related function and still unity gives me the warning, probably because I have some custom event that is named onMouse_something. I'd say just ignore it
     
  14. DanielVanches

    DanielVanches

    Joined:
    Apr 19, 2012
    Posts:
    38
    Hi songtan. I just bought Input.Touches, and I'm learning how to use it by looking at the provided examples, but I'm wondering if you have any available documentation to have a good reference and implement it faster?

    Regards.
     
  15. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Hi Daniel,

    Thanks for your purchase. I'm afraid the included PDF documentation and the examples are all the resources available. Thing is, all the gesture can be used for any purpose so the actual implementation is very much application dependent. If you know what to do and what gesture you are looking for, you simple use the event and the information passed and use in your code. In that sense, I dont quite understand what do you mean by implement it faster. But If you mean to know what gesture event to listen to, you can tell me about the specific implementation you want and I could point you in the right direction.

    Hope this helps.
     
  16. DanielVanches

    DanielVanches

    Joined:
    Apr 19, 2012
    Posts:
    38
    Thanks for your quick reply!

    Oops, I went directly to the example folders and didn't notice the PDF. My bad.

    Thanks a lot!
     
  17. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Just a quick note that I'll be travelling for a week starting now. Apologize in advance for the delay in responding to any post.
     
  18. krillmcrawl

    krillmcrawl

    Joined:
    Feb 18, 2011
    Posts:
    29
    I modded the RTSCam script and added a Single tap funtion in there, I also activated the tap detector in that scene.
    I look for a single tap on the ground (the Cube). Works fine in playmode in editor 100% of the time but in a Android build it only works maybe 50% of the times i click on the Cube. Does anyone have any idea whats going on here?

    Best Regards,

    Kristian
     
  19. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Do you get a solid 30+ fps on your device with your scene? Anything below say 22fps or so, not all touches always register smoothly..
     
  20. krillmcrawl

    krillmcrawl

    Joined:
    Feb 18, 2011
    Posts:
    29
    Yes I got a solid 60+ fps, it's just that simple scene with 4 boxes. But thanks for the suggestion, I had not checked that:)
     
  21. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Just chipping in for songtan here :D what device is this? Do all other touches/taps in all other apps always register smoothly at all times? "Input.Touches" works great for me on 2 test devices, but they're both the same brand so I got limited real-world exposure in a way
     
  22. krillmcrawl

    krillmcrawl

    Joined:
    Feb 18, 2011
    Posts:
    29
    It's a Galaxy S3 and it's usually a very smooth experience. The pinch zoom and drag etc from input.touches is working 100% of the time in the same scene on the device.
     
  23. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Hi guys, sorry for being away.

    I've tried it on my iPhone (adding a tap to RTSCam) with only a problem so far. Try check the MaxTapDisplacementAllowance in the Gesture prefab. If you have a relatively small value like 5 (default), try increase it to 20 or 30. The problem might be the because the higher screen defination on a smaller device, the position deviation of a touch could easily span over the specified limit.

    But bear in mind because I've only got my iPhone to test on so if the issue is Android specific, I probably cant do much.
     
  24. krillmcrawl

    krillmcrawl

    Joined:
    Feb 18, 2011
    Posts:
    29
    That did it, by increasing the MaxTapDisplacementAllowance it now works perfect! Thanks
     
  25. Spartan_Boy

    Spartan_Boy

    Joined:
    Jul 8, 2012
    Posts:
    38
    Hey songtan! have you updated the package without the foreach? We made a fun game with plenty of interactivity and notice all the gestures stopped after a few minutes of tapping, swiping, double-taping and long tapping? Is there a chance that it is related to our bug ? Not saying it is coming from you, we have used it extensively without any problem so far but plenty of interactivity seems to freeze our gestures layer.
    For those who haven't bought it this package is very very nice!
     
  26. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I have made the change but I havent update it on the AssetStore. I've pm it to you

    Can you elaborate about the bug you are having? Does it freeze the whole application? Or the app just stop responding to any gesture? Is there any error on the log? I've fixed a small bug back then, not sure if it's related to what you are experiencing, but try the update and let me know how it goes.
     
  27. Spartan_Boy

    Spartan_Boy

    Joined:
    Jul 8, 2012
    Posts:
    38
    Hey songtan, thx for your usual kind and quick support, I'll have a go with your patch and let you know, but yes only gesture stop responding in our app.
    I'll check for the log. Thx for the pm ;-)
     
  28. TimB

    TimB

    Joined:
    Jan 19, 2011
    Posts:
    65
    Has anyone had issues with onShortTapE being kind of slow or non-existent on iOS? It seems to work great in the editor with a mouse click, but on iOS it only fires once and awhile. I've tried messing with the Short Tap Time param, but that did not seem to help.

    Or is there a better way to detect a quick tap? I can't do it on touch, because I also need to detect swipes and charging.

    Thanks
     
  29. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Any plans for doing so at some point? :D I just like to keep track of all assets' latest-version updates via Asset Store...
     
  30. vicenterusso

    vicenterusso

    Joined:
    Jan 8, 2013
    Posts:
    130
    Just wondering... when Gesture.onTouchE gets called? I have tested and only Up and Down events are called..
     
  31. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Sorry for the slow respond guys. Thing has been very hectic for me.

    @TimB, try increase the MaxTapDisplacementAllowance value on Gesture prefab. It has been known such issue could be caused by higher screen defination on a smaller device, the position deviation of a touch could easily span over the specified limit.

    @metaleap, normally I'll only do an update when there's an substantial amount of addition/fix has been done. Butseeing I'm not going to add anything new in foreseeable future, I'll try to get this done when I can. By which I mean when my internet connection is back to normal. I've been having trouble with it for the past few days. It has become a real pain to do anything that require stable connection.

    @vicenterusso, it should be call whenever there's a finger on the screen. Please note that it only works on a touch device.
     
  32. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Sorry to hear life is hectic right now! I notice, doing a two-finger rotation gesture fires a pinch event. Basically, any kind of two-fingers-on-screen fires my pinch event.

    And I can't quite work out how to filter this myself, because pinch-magnitude in onPinch seems pretty unpredictable. Since it fires all the time as the fingers move even 1/100th of a nanometer, instead of when the gesture has finished, it's hard to make sense of the pinch functionality right now. Any ideas?
     
  33. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I cant seem to replicate the behaviour. It works just fine on my iPhone. The magnitude dont seems to be very consistent yes but that's just the nature of the input. I dont think anyone can expect do a consistent movement on such miniature scale (we are talking pixels here). The problem seems to be the defination of the touch phase. It shouldnt fire unless both of the fingers are moving. So maybe somehting is wrong with the native touch input if you say the event is firing even with the slightest of movement.

    At any rate here something you can try, in DualFingerDetector.cs, line 100. It should be something like this:

    Code (csharp):
    1.     PinchInfo pinchInfo=new PinchInfo(pinch, pos1, pos2);
    2.     Gesture.Pinch(pinchInfo);
    You can modify it to something like this:

    Code (csharp):
    1.     if(Mathf.Abs(pinch)>1){
    2.         PinchInfo pinchInfo=new PinchInfo(pinch, pos1, pos2);
    3.         Gesture.Pinch(pinchInfo);
    4.     }
    This should stop the event from firing unless the pinch value is bigger than 1. Then feel free to play a bit with the threshold value, see if changing the value help.
     
  34. gregmax17

    gregmax17

    Joined:
    Jan 23, 2011
    Posts:
    186
    Hello, just a quick question here. Is there a way to get the onSwipeEndE to be called after the finger/mouse up event? It is seems to be calling even if my finger/mouse is down. Can this be perhaps an option for the Swipe Detector?

    Thanks in advance!
     
  35. boblin

    boblin

    Joined:
    Apr 9, 2013
    Posts:
    3
    Bought this package quite a long time ago, but just started to use it. I use it with playmaker.
    I set scene up as it was written in manual, dropped two prefabs on scene: gesture and PlayMakerInputTouchesProxy.
    The problem is, it does not ALWAYS react to taps on phone, the TAP event is not always triggered.
    When i run the scene in unity, it reacts to mouse in 100% cases, but when it comes to testing on phone (galaxy s4, if that does matter), i have something like 90% response rate, and that is really sad. Any suggestions?

    Before i started using input.touches, i used onMouse click event, and it worked in 100% of cases.
     
  36. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I believe it's a known issue due to the better screen resolution over a small device size. Try increase the value of maxTapDisplacementAllowance on the Gesture prefab should help. The default value is set at 5, rather small when you have a smaller device with relatively high resolution. In the short instance when the finger touch and leave the scree, the position deviation on screen could easily exceed the value. To be safe, try it with the value set to something like a 100, then gradually decrease it when it work, if you dont want to trigger a tap event when swiping/dragging.
     
  37. boblin

    boblin

    Joined:
    Apr 9, 2013
    Posts:
    3
    Thanks, it seems like my issue. I tried reacting to Down events and it works 100%, so it might be micro-swipes. Would not it be wise (if possible) to make maxTapDisplacementAllowance relative to screen size?
     
  38. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    It's a bit more complicated than that. The problem is not so much about screen size or screen resolution. It's about screen physical size to resolution ratio. This is defferent from device to device. For instance, the resolution of older iPad is 1024x768 and the resolution of iPhone is 960x640. Roughly the same but the iPad is more than twice the size of iPhone so the resolution to size ratio is very different. In short, iPad is less sensitive to the position change of any touch input in comparision to iPhone. So the default value of 5 may be a bit too low for the devices with much higher resolution and smaller screen size but it could be just right for devices that has it other way round.

    To add to that, there's no sure way to get get the device physical size from from coding as far as I know. So even if I want to automate this somehow, there's no way to do it. I would leave it open so that user may adjust the the value to fit thier application and the target build device.
     
  39. boblin

    boblin

    Joined:
    Apr 9, 2013
    Posts:
    3
    what about Screen.dpi property unity kindly offers us?
    I think knowing resolution and dpi we can get physical sizes. Sure it can be done manually, but i think this is nice to have option.
     
  40. Mars91

    Mars91

    Joined:
    Mar 6, 2012
    Posts:
    572
    Pm sent
     
  41. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    @boblin, dpi huh... I wasnt to the fact that the info is available. I'll see if I can do anything about it. Thanks for the tip.

    @FootPrintGames, replied!
     
  42. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Sadly that one is hit-and-miss. It's not always provided or can give wildly inaccurate values (24567 dpi, anyone? Happened on some Samsung devices. 0 dpi aka unknown dpi -- most Windows devices, touch-screen or not.)

    So personally I suspect it's overall saner to deal with Screen.dpi on a project-specific / case-by-case basis than to attempt to generalize --- unless someone comes up with some really smart heuristics ;)
     
  43. jimichus

    jimichus

    Joined:
    Nov 26, 2013
    Posts:
    1
    Hi, we are developing a game using Input.Touches and we are having a hard time figuring how to make pause the game when 3 fingers touch the screen.

    Our code looks like this, and judging with the documentation provided with the asset, it should work !

    if(tap.fingerCount == 3)
    {
    pause.togglePause();
    }

    by the way this is for android. Any idea why it doesn't work?
     
  44. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I tested with the TapDemo and it seems to be working right out of the box. Make sure you are listening to event onMFMutiTapE, not onMultiTapE. Also just to be safe, you might want to adjust the MaxFingerGroupDist value onTapDetector. Try increase it if it doesnt work. I need to increase the value to 300 in order to get it to work on my iPhone.
     
  45. roots

    roots

    Joined:
    Apr 5, 2012
    Posts:
    54
    Hi,

    I was hoping someone could validate the Input.Touches supports:
    - 1 finger swipe (left/right/up/down) - to pan
    - 2 finger swipe (left/right/up/down) - to rotate
    - pinch - to zoom in / out

    I do have my own functions to move the camera so i would just want to call these when the touch event happens. e.g. if 1 fingers swipe left "moveCameraLeft()" etc for the rotate and pinch. I guess i don't want touch scripts that are hardcoded to main camera's.

    Hopefully this can be integrated fairly easily and has good examples to follow. I only need basic outputs (e.g. don't care about the length of the swipe just which direction (up-down-left-right) and if there were 1 or 2 fingers used. The same goes for the pinch.

    Can you please let me know it does all of this?

    Thanks
     
  46. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Hi roots,

    Thanks for the interest. All the things you want are supported and can be done fairly easily, apart from one. That is InputTouches doesnt support 2 fingers swipe. What you can use instead is 2 fingers drag. It's like what shown on the demo on RTSCam, like swipe, but doesnt take speed and finger-on-screen duration into account.

    So basically, swipe event provides you the angle of the swipe so you can know which camera direction to call. Drag doesnt gives you any angle but you can caculate it via a built in function call to get the angle and hence direction. Pinch works exactly like how you want it, just a value indicating pinch in or out.

    Hope this help.
     
  47. roots

    roots

    Joined:
    Apr 5, 2012
    Posts:
    54
    Thanks Songtan, is it possible to see the documentation / samples before purchasing? I went to your website but couldn't see these. Also if I can suggest a quick YouTube where you import the package into a project?

    Or, if it is quick and easy, some reference code for my use case scenario's? I believe these are a very common way to control camera's on touch devices (move, rotate and zoom).

    Thanks and appreciate the speedy response.

    ps. sorry what I read in your "two years in business" thread on Input.Touches. Find that very lame, the key on what you can do is simply provide good support and keep enhancing the product. I think this area is still in need of a robust, flexible complete solution so developers can focus on the real game mechanics. If I end up using Input.Touches will let you know when my game goes live and ensure you get credits for it.
     
  48. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    It's very simple. To start, drag the Gesture prefab in the InputTouches package into the scene. The prefab will detect and fire relevant event if any specific input/gesture is detected. All you need to do is to listen to the event you want to respond to.

    For instance, zoom:
    Code (csharp):
    1.     void OnEnable(){
    2.         Gesture.onPinchE += OnPinch;
    3.     }
    4.    
    5.     void OnDisable(){
    6.         Gesture.onPinchE -= OnPinch;
    7.     }
    8.    
    9.     void OnPinch(float val){
    10.         if(val>0){
    11.             //zoom in
    12.         }
    13.         else if(val<0){
    14.             //zoom out
    15.         }
    16.     }

    for swipe:
    Code (csharp):
    1.     void OnEnable(){
    2.         Gesture.onSwipeE += OnSwipe;
    3.     }
    4.    
    5.     void OnDisable(){
    6.         Gesture.onSwipeE -= OnSwipe;
    7.     }
    8.    
    9.     void OnSwipe(SwipeInfo sw){
    10.         if(sw.angle>45  sw.angle<=135){
    11.             //up
    12.         }
    13.         else if(sw.angle>135  sw.angle<=225){
    14.             //left
    15.         }
    16.         else if(sw.angle>225  sw.angle<=315){
    17.             //down
    18.         }
    19.         else if(sw.angle>315  sw.angle<=45){
    20.             //right
    21.         }
    22.     }
    I've pm you the documentation so you can have a read.


    Not sure where you read that from. I dont see it in the start of this thread, as well as on my website. Anyway, I've always pride myself with providing good support keep on developing the product based on feedback. However the development for Input.Touches has slow down or almost stop tho. Not that I've given up, but I myself is very happy using it in it's current stage. And there's not much complaint about what can be done better since the last major update.
     
  49. roots

    roots

    Joined:
    Apr 5, 2012
    Posts:
    54
    Thanks that is very helpful. On the two-years-in-business, i was referring to your comment around piracy of assets. That is the part i find very lame.

    Let me have a look at the docs and the sample code.

    Thanks again....
     
  50. roots

    roots

    Joined:
    Apr 5, 2012
    Posts:
    54
    I assume that this:
    void OnPinch(float val){
    if(val>0){
    //zoom in
    }
    else if(val<0){
    //zoom out
    }
    }

    should be:
    void OnPinch(PinchInfo val){
    if(val.magnitude>0){
    //zoom in
    }
    else if(val.magnitude<0){
    //zoom out
    }
    }