Search Unity

[RELEASED] Easy Touch

Discussion in 'Assets and Asset Store' started by Hedgehog-Team, May 8, 2012.

  1. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
    @Hedgehog-Team

    I've just upgraded my project to 5.4.1p1 (from 5.3.6p4) and ended up with this compile error: "Type `HedgehogTeam.EasyTouch.Gesture' does not contain a definition for `pressure' and no extension method `pressure' of type `HedgehogTeam.EasyTouch.Gesture' could be found (are you missing a using directive or an assembly reference?)"

    any suggestions?
     
  2. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    hi,

    Ok, open the script basefinger.cs and remove the lines 62 #if UNITY_5_3 & 70 #endif
     
  3. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
    Done, thanks! Btw, I also had to remove same from definition lines 32 & 41...
     
  4. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,191
    If i have both On_TouchStart and On_DoubleTap the On_TouchStart is trigger every time i do a double click. Any way to avoid that?
     
  5. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    On_TouchStart is the basic event that fires each time a touch start even in double tap.

    If you have manage two different opertationd on the same object with TouchStart and Double tap, and you dont want execute On_TouchStart operation for a double tap, you must wait a little time to know if the user will do a double tap or.

    You can manage this with a coroutine
     
  6. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,191
    Good point, thanks :)
     
  7. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    Hi. I got "EasyTouch 5: Touchscreen & Virtual Controls". When I import the asset I see two main categories: EasyTouch, and EasyTouch Controls. What is the difference?

    I want to implement a flicking mechanism in my game. I don't want a joypad or some control on the screen. I just want to use a gesture to flick an object at a target. Which should I import?

    Also, for prototyping and trying things in the Unity Editor Game window, is it possible to simulate gestures with the mouse?
     
    Last edited: Oct 31, 2016
  8. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    EasyTouch = Gesture management
    EasyTouch Controls = Virtuals controls like joystick, button, touchpad

    For that you want, you need to import EasyTouch, but you can import the all bundle event if you don't use virtual control

    Yes gesture simulation is already done even in Unity Editor
     
  9. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    335
    My app already having traditional WASD controls working fine.

    I would like to Swip Up,Down,Left and Right to simulate they keys and if possible keep the existing WASD operational for testing in the editor.

    What's the easiest way to do it with easy touch ?

    regards
     
  10. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    You have several way to do that, if you wan show me your script that manages WASD, it will be more simple for me to give you the best solution
     
  11. f1chris

    f1chris

    Joined:
    Sep 21, 2013
    Posts:
    335
    ok, don't have access to it for now but it's a typical InputManager.cs with a bunch of if statements :

    if ( Input.GetKey(Keycode.LeftArrow)
    ..... do this....
    else if ( Input.GetKey(Keycode.RightArrow)
    ..... do that....
     
    Last edited: Nov 9, 2016
  12. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    You do a simple solution like this one, you interpret the swipe and store his direction in a variable.

    Code (CSharp):
    1.     private EasyTouch.SwipeDirection swipeDirection;
    2.  
    3.     void OnEnable()
    4.     {
    5.         swipeDirection = EasyTouch.SwipeDirection.None;
    6.         EasyTouch.On_SwipeEnd += On_SwipeEnd;
    7.     }
    8.  
    9.     void OnDisable()
    10.     {
    11.         EasyTouch.On_SwipeEnd -= On_SwipeEnd;
    12.     }
    13.  
    14.  
    15.     void On_SwipeEnd(Gesture gesture)
    16.     {
    17.         swipeDirection = gesture.swipe;
    18.     }
    19.  
    20.     void Update () {
    21.        
    22.         if (Input.GetKey(Keycode.LeftArrow) || swipeDirection == EasyTouch.SwipeDirection.Left)
    23.         {
    24.  
    25.         }
    26.  
    27.         swipeDirection = EasyTouch.SwipeDirection.None;
    28.     }
    don't forgest to enable this option, to allow swipe event if the start is over a gameobject
    upload_2016-11-9_20-9-58.png

    Or without event ...


    Code (CSharp):
    1.   private EasyTouch.SwipeDirection swipeDirection;
    2.  
    3.    
    4.    void Start()
    5.     {
    6.         EasyTouch.instance.alwaysSendSwipe = true;
    7.     }
    8.  
    9.     void Update () {
    10.  
    11.         Gesture gesture = EasyTouch.current;
    12.  
    13.         if (gesture.type == EasyTouch.EvtType.On_SwipeEnd)
    14.             swipeDirection = gesture.swipe;
    15.  
    16.         if (Input.GetKey(Keycode.LeftArrow) || swipeDirection == EasyTouch.SwipeDirection.Left)
    17.         {
    18.                   // Do left action
    19.         }
    20.  
    21.         swipeDirection = EasyTouch.SwipeDirection.None;
    22.     }
     
  13. ianjgrant

    ianjgrant

    Joined:
    Mar 11, 2013
    Posts:
    28
    Hi, I'm using UniOSC to implement an iOS remote control for my game. I am receiving an OSC data bundle and detecting all the touch event and data I need. On my 'master' controller (that receives the OSC data) it would be very helpful if I could generate an EasyTouch event to invoke the already existing EasyTouch actions on the gameObject, for example, all the actions listed on a QuickPinch component. Is that possible?

    I can access the component:

    Code (CSharp):
    1. QuickPinch myPinch = (QuickPinch)puppetControllerTransform.gameObject.GetComponent(typeof(QuickPinch));
    Can I then invoke the On Pinch Action(s) listed in that component in some way?

    Thanks in advance,

    Kind regards, Ian
     
  14. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    It is not intended that you can invoke the events yourself. Because behind the QuickGesture there is EasyTouch, it would be necessary to order the sending of event to EasyTouch with the class Gesture Correctly parameterized

    By cons compared to what you wish to do, it might be interesting that events call methods where you are stored your treatment. You could then use these methods for your remote control.
     
  15. a-dogg

    a-dogg

    Joined:
    Jun 18, 2008
    Posts:
    22
    Hey Nicolas. FYI, the link in your footer "Hedgehog Team community forum for any questions or support" seems to have an expired domain or the like... it goes through a series of redirects and ends up at a phishing site telling me I have a virus and I should call the 888 number to get it fixed ;) So that's less than ideal for support.

    Could you point me in the right direction re: pinch zoom from the origin of the zoom as opposed to zoom from the center only, or are we out of luck there?

     
  16. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    thank you, it's fixed.

    You can look at two fingers example where I scale in or out a sphere, you will just to modify my moving the camera and Z axis for the zoom
     
  17. castingflame

    castingflame

    Joined:
    Jan 29, 2016
    Posts:
    35
    Where is the manual? Sorry if its a silly question
     
  18. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    You have the folders "Documentation" for each package EasyTouch and EasyTouchControl
    upload_2016-12-15_0-1-2.png
     
  19. castingflame

    castingflame

    Joined:
    Jan 29, 2016
    Posts:
    35
    Thank you. I'm quite new to Unity and this is my first Purchase from the Asset Store.
     
  20. castingflame

    castingflame

    Joined:
    Jan 29, 2016
    Posts:
    35
    I have just about managed to get the joystick moving my spaceship by looking at one of your videos on youtube.

    My code continually moves my ship left if I hold down the left arrow.


    //Player movement
    if (Input.GetKey(KeyCode.LeftArrow))) {

    transform.position += Vector3.left * speed * Time.deltaTime;
    }


    Using your video I have done this to use your joystick control


    if (ETCInput.GetAxisDownLeft("Horizontal")) {
    transform.position += Vector3.left * speed * Time.deltaTime;
    }

    But the ship only moves one position at a time and I have to keep wiggling the joystick for it to keep moving.

    What is the best "Easy, idiot" way to start learning how to use your plugin properly?


    P.S. How have you formatted your code on here?
     
  21. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    Your ship moves one position at a time, because you use GetAxisDownLeft, this method returns true during the frame the user move left the axis (documentation page 22/70). For your need you you two choices must

    // Exactly what you have done
    Code (CSharp):
    1. if (ETCInput.GetPressedAxis("Horizontal")){
    2.      transform.position += Vector3.left * speed * Time.deltaTime;
    3. }
    // But generally we take into account the value of the axis
    Code (CSharp):
    1. float h = ETCInput.GetAxis("Horizontal");
    2. transform.position += Vector3.left * speed * Time.deltaTime * h;
    The EasyTouch methods have the same name as those of Unity in the Input class, in order to facilitate migration
     
  22. castingflame

    castingflame

    Joined:
    Jan 29, 2016
    Posts:
    35
    Excellent. The joystick was inverted so I just changed;

    Time.deltaTime* h; to Time.deltaTime* -h;

    or

    Vector3.left to Vector3.right


    Both worked okay.


    I will dig a lot deeper into your great product a bit later on when I have learned a lot more on my Online Unity course. For now, I am able to move my little game to Android to have fun. Your product looks amazing but your support is just as important so from a beginner who finds everything tough, a massive thank you Nicolas and keep up the good work. :)
     
  23. castingflame

    castingflame

    Joined:
    Jan 29, 2016
    Posts:
    35
    I have a ETC Joystick and Button in my project. I am trying to get/set the Size property (Thumb size for Joystick) for the controls in my script as I wish to be able to scale the Joystick at runtime. I have looked through the "EasyTouchControls_APIDocumentation" but I can not find what I need.

    It would be useful to be able to change the following;

    Joystick
    Position & Size - Thumb Size, Background Size, Offset x&y, Anchor

    Button
    Position & Size - Size, Offset x&y, Anchor



    Thanks, Paul
     
  24. castingflame

    castingflame

    Joined:
    Jan 29, 2016
    Posts:
    35
    Is there any support still? I have also asked the question on the Hedgehog forum.
     
  25. hanneshu

    hanneshu

    Joined:
    Nov 5, 2014
    Posts:
    1
    Hey Nicolas! just brought this nice asset yesterday and tried to register at the Hedgehog forum. Is it still active? I haven't recived the activation mail :/
     
  26. castingflame

    castingflame

    Joined:
    Jan 29, 2016
    Posts:
    35
    Seems dead. i am not too happy. I have had to buy TheUltimate .... collection of suff now.
     
  27. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    734
    mmm... Nicolas is a very responsive developer.
    Sometimes Unity forum forgets to notify a new post.
    I advise you to contact him directly at the support forum or at the support mail.
     
  28. castingflame

    castingflame

    Joined:
    Jan 29, 2016
    Posts:
    35
    I have done that already on the same day. Maybe he is unwell.
     
  29. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,191
    Can you please help me getting pinch to work, i have the following script just for testing:

    Code (CSharp):
    1. public float FOVMin = 10;
    2.     public float FOVMax = 60;
    3.  
    4.     void On_PinchIn(Gesture gesture){
    5.         float zoom = Time.deltaTime * gesture.deltaPinch*5;
    6.         print ("On_PinchIn: " + zoom);
    7.     }
    However, it does not fire. I use the alt key and press mouse to pinch on screen.
     
  30. tommaso-di-vino

    tommaso-di-vino

    Joined:
    Sep 25, 2014
    Posts:
    4
    Hi,

    I have EasyTouch 3.1.
    I've just upgraded my project to Unity 5.5 from 5.3 and there are a few problems:


    1. I get the next warning:

    "OnLevelWasLoaded was found on EasyJoystick
    This message has been deprecated and will be removed in a later version of Unity.
    Add a delegate to SceneManager.sceneLoaded instead to get notifications after scene loading has completed"

    Is it important?

    2. All the functions work well, but clicking on any EasyTouch element in the Hierarchy, I get this error message:

    "set_left is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'GUIEasyTouchInspector'.
    See "Script Serialization" page in the Unity Manual for further details.
    UnityEngine.RectOffset:.ctor(Int32, Int32, Int32, Int32)
    GUIEasyTouchInspector:.ctor() (at Assets/EasyTouch/Plugins/Editor/GUIEasyTouchInspector.cs:13)"

    also with: 'GUIEasyButtonInspector', 'GUIEasyJoystickInspector'

    Should I worry about it? Is there any solution?


    3. (Solved?)

    "Assets/EasyTouch/Plugins/Editor/GUIEasyTouchInspector.cs(58,23): warning CS0618:
    `UnityEditor.EditorGUIUtility.LookLikeControls()' is obsolete: `LookLikeControls and LookLikeInspector modes are deprecated.
    Use EditorGUIUtility.labelWidth and EditorGUIUtility.fieldWidth to control label and field widths.'"

    My solution (Is it ok?):
    //EditorGUIUtility.LookLikeControls();
    EditorGUIUtility.labelWidth = 0;
    EditorGUIUtility.fieldWidth = 0;

    Thanks
     
  31. MelodyKayeX

    MelodyKayeX

    Joined:
    May 26, 2015
    Posts:
    1
    Hi,

    How can I disable multi-touch? Because I just want to be able to touch/drag one gameobject at a time. I attached Quick Drag and Quick Touch components on my gameobjects.

    Thanks.
     
  32. animaguy

    animaguy

    Joined:
    Dec 10, 2015
    Posts:
    32
    I just purchased the latest version of Easy Touch on the Unity Asset Store yesterday.

    I am currently looking for tutorials on how to use it.

    Any recommendations would be most appreciated.
     
  33. terry213

    terry213

    Joined:
    Nov 17, 2016
    Posts:
    20
    How come the joystick only moves when the arrows are pressed and not when the user drags them? I'm also using playmaker.
     
  34. terry213

    terry213

    Joined:
    Nov 17, 2016
    Posts:
    20
    What are the positive and negative buttons for the virtual joystick?
     
  35. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,191
    my On_TwistEnd does not trigger?

    Code (CSharp):
    1. // Subscribe to events ("1f" means one finger ...)
    2.     void OnEnable(){
    3.         EasyTouch.On_TouchStart += On_1f_TouchStart;
    4.         EasyTouch.On_LongTapStart += On_1f_LongTapStart;
    5.         EasyTouch.On_LongTapEnd += On_1f_LongTapEnd;
    6.         EasyTouch.On_DoubleTap += On_1f_DoubleTap;
    7.         EasyTouch.On_Drag += On_Drag;
    8.         EasyTouch.On_DragEnd += On_DragEnd;
    9.         EasyTouch.On_DragStart += On_DragStart;
    10.         EasyTouch.On_Twist += On_Twist;
    11.         EasyTouch.On_TwistEnd += On_TwistEnd;
    12. //        EasyTouch.On_TouchStart2Fingers += On_TouchStart2Fingers;
    13. //        EasyTouch.On_TouchDown2Fingers += On_TouchDown2Fingers;
    14. //        EasyTouch.On_TouchUp2Fingers += On_TouchUp2Fingers;
    15.         EasyTouch.On_SimpleTap2Fingers += On_SimpleTap2Fingers;
    16.         EasyTouch.On_DoubleTap2Fingers += On_DoubleTap2Fingers;
    17. //        EasyTouch.On_LongTapStart2Fingers += On_LongTapStart2Fingers;
    18.         EasyTouch.On_LongTap2Fingers += On_LongTap2Fingers;
    19. //        EasyTouch.On_LongTapEnd2Fingers += On_LongTapEnd2Fingers;
    20. //        EasyTouch.On_Swipe += On_Swipe;
    21.         Application.logMessageReceivedThreaded += HandleLog;
    22.     }
    23.      
    24.     // Unsubscribe
    25.     void OnDisable(){
    26.         EasyTouch.On_TouchStart -= On_1f_TouchStart;
    27.         EasyTouch.On_LongTapStart -= On_1f_LongTapStart;
    28.         EasyTouch.On_LongTapEnd -= On_1f_LongTapEnd;
    29.         EasyTouch.On_DoubleTap -= On_1f_DoubleTap;
    30.         EasyTouch.On_Drag -= On_Drag;
    31.         EasyTouch.On_DragEnd -= On_DragEnd;
    32.         EasyTouch.On_DragStart -= On_DragStart;
    33.         EasyTouch.On_Twist -= On_Twist;
    34.         EasyTouch.On_TwistEnd -= On_TwistEnd;
    35. //        EasyTouch.On_TouchStart2Fingers -= On_TouchStart2Fingers;
    36. //        EasyTouch.On_TouchDown2Fingers -= On_TouchDown2Fingers;
    37. //        EasyTouch.On_TouchUp2Fingers -= On_TouchUp2Fingers;
    38.         EasyTouch.On_SimpleTap2Fingers -= On_SimpleTap2Fingers;
    39.         EasyTouch.On_DoubleTap2Fingers -= On_DoubleTap2Fingers;
    40. //        EasyTouch.On_LongTapStart2Fingers -= On_LongTapStart2Fingers;
    41.         EasyTouch.On_LongTap2Fingers -= On_LongTap2Fingers;
    42. //        EasyTouch.On_LongTapEnd2Fingers -= On_LongTapEnd2Fingers;
    43. //        EasyTouch.On_Swipe -= On_Swipe;
    44.         Application.logMessageReceivedThreaded -= HandleLog;
    45.     }
    46.  
    47.     // Destroy
    48.     void OnDestroy(){
    49.         OnDisable ();
    50.     }
    51.  
    52. public void On_Twist (Gesture gesture) {
    53.         print ("On_Twist gesture: " + gesture.pickedObject.tag);// + " Sel: " + selected_GO.tag);
    54. }
    55.  
    56. public void On_TwistEnd( Gesture gesture){
    57.         print ("On_TwistEnd");
    58. }
    The other xxxEnds works.

    I have two situations here:

    1) If i do the twist directly on a object it works sometimes
    2) If I first press the object, allocated to selected_GO, it twist but the twistEnd does not work

    >>> PROBLEM FIXED <<<
    By disable "Enable Pinch" in EasyTouch all is now working.
     
    Last edited: Apr 6, 2017
  36. gamingtc

    gamingtc

    Joined:
    Nov 22, 2016
    Posts:
    21
    Can this controller detect gesture's shape like circle, square, W, I? If not, can we extend gesture code to detect shaped gestures?
     
  37. GamerPET

    GamerPET

    Joined:
    Dec 25, 2013
    Posts:
    370
    Hello there!

    I recently bought Easy Touch after being recommended my Jean from PlayMaker.

    I'm using PlayMaker in my project. All I want to do is do a "swipe" in order to move the camera around.
    How would I do this with playmaker? I tried to read the documentation but I get no specification for that. I also opened the test scene and I do see a "Easy Touch Quick Swipe" action being used.

    What else do I need to add to the scene?

    I tried to play the demo scene in the editor just for testing, and I get those errors:



    Thanks!
     
  38. finx

    finx

    Joined:
    Mar 31, 2017
    Posts:
    6
    Hello I bought this asset and I would like to make a game like OSU! For tablet however I do not know how you could do the parts where it is kept pressed and made a drag by a path. Can someone help me with that?

    Try to do it with colliders but when they collide with one nothing happens but when it drops it bounces out of the collider.

    I leave a reference video of what I want to do.

     
  39. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    320
    Hi,

    I'm using a modified frustum (oblique perspective), now the raycast for gesture.pickedObject is way off. Any fix for that?
     
  40. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    sorry for the delay, but another time Unity notification doesn't work anymore ...

    GamerPet
    Do you have look at Play maker swipe example ?

    Finx
    You have just to do as the drag exemple, but you need to desactivated the collision on the same layer to prevent bounce

    Ikazrima
    Do you have an example to provide to me ?
     
  41. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    320
    @Hedgehog-Team

    Custom camera frustum
    Code (CSharp):
    1. Matrix4x4 mat = _camera.projectionMatrix;
    2.  
    3.         mat[0, 2] = horizObl;
    4.         mat[1, 2] = vertObl;
    5.         _camera.projectionMatrix = mat;
    Swipe gesture
    Code (CSharp):
    1.  void On_Swipe(Gesture gesture)
    2.     {
    3.         Vector3 newPos = _camera.ScreenToWorldPoint(gesture.position);
    4.         testTransform.position = newPos;
    5.     }
    Red circle is swipe position
    Edit : Punk guy should be directly at touch position.
    upload_2017-5-6_1-53-36.png

    Red box is custom frustum
     
    Last edited: May 5, 2017
  42. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
  43. ikazrima

    ikazrima

    Joined:
    Feb 11, 2014
    Posts:
    320
    Sorry, yup I figured it's from Unity side and not from Easy Touch. Using Input.mousePosition also produces the same problem.

    On a side note, there's a difference between isometric vs oblique. This blog explains it better if you're interested.

    Cheers.
     
  44. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,191
    Just so you know, when i patched to 5.6.1 Unity reset all EasyTouch properties. ...a bunch of UNET properties as well.
     
  45. DreamEnder

    DreamEnder

    Joined:
    Apr 12, 2011
    Posts:
    191
    How would I go about getting the twist gesture speed at which the user twisted?
     
  46. DreamEnder

    DreamEnder

    Joined:
    Apr 12, 2011
    Posts:
    191
    I think I figured it out:

    float spinSpeed = Mathf.DeltaAngle (gesture.twistAngle, twistAngleStart)/gesture.actionTime;

    I saved twistAngleStart at the start of the twist.
     
  47. kaluis

    kaluis

    Joined:
    Jun 11, 2017
    Posts:
    1
    How do you think is the best way to hide the controls when building for pc?
     
    Last edited: Jun 15, 2017
  48. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    You can manage all your virtuals control in a spearated canvas, and disable it wen you are on standalone...
     
  49. RolfBertram_dot_me

    RolfBertram_dot_me

    Joined:
    Mar 1, 2011
    Posts:
    128
    Error Message: "ETCInput : ETC Camera Distance doesn't exist"
    VehicleCameraController.cs:215: "distance -= ETCInput.GetAxis("ETC Camera Distance") * distanceSpeed;"

    QuickPinch parameters in editor: VehicleCameraController.name = ETC Camera Distance

    What am I doing wrong?
     
  50. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi,

    GetAxis need the axis name, not the control name ....