Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[RELEASED] Easy Touch

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

  1. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,154
    Ah you destroy the canvas ! , You didn't say :)

    I'm going to try,but I'll be honest, I never imagined that the canvas would be destroyed in the current scene
     
  2. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,154
    I just made a simple test with this script :

    Code (CSharp):
    1. public class DestroyControlCanvas : MonoBehaviour {
    2.  
    3.     public GameObject canvasScene;
    4.  
    5.     public GameObject canvasPrefab;
    6.  
    7.  
    8.     void Update(){
    9.  
    10.         if (Input.GetKeyDown(KeyCode.I)){
    11.             Instantiate( canvasPrefab, Vector3.zero,Quaternion.identity);
    12.         }
    13.  
    14.         if (Input.GetKeyDown( KeyCode.D)){
    15.             Destroy ( canvasScene );
    16.         }
    17.  
    18.         if (ETCInput.GetButtonUp("ButtonTest")){
    19.             Debug.Log("ok");
    20.         }
    21.  
    22.     }
    23. }
    Indeed the button doesn't work, because I had not planned this, and the dictionary already have this key, so I get the following log:
    EVCInput control : ButtonTest already exists.

    I'll do it necessary, but I am still very surprised that you do not have any waring. (I really would need your sccene).
     
  3. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,146
    Tomorrow I will put together a pack with the scene and I will send it to you by email.
     
  4. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,154
    Ok thank you
     
  5. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,154
    Even if your case wasn't handled, I managed to redo your case without log display. It happens if you instantiate prefab, has a different control name of it already present.

    Example :
    * I created a button
    * I created a prefab
    * I renamed the button without update prefab
    =>No errors, no log, because during instantiation control registers correctly in the dictionary with name in the prefab

    I added the ability to destroy the canvas or controls in the current scene. By cons I can not do anything in the case of a misnomer

    I'll wait for your example before validating the update
     
  6. markgize

    markgize

    Joined:
    Jan 12, 2013
    Posts:
    7
    Hey, I am looking to purchase Easy Touch but have a few questions before I do so (I did try to register with the Hedgehog forum but there was no response). I want to rapidly add an iOS touch interface to my game using swipe, pinch, expand and twist to move the main camera with double tap invoking my UI. To this end, I don't care where a gesture occurred or what game objects it might have touched, I just want to know, for a given frame, that a particular gesture was in effect after which I can move the main camera as appropriate or kick off my UI script.

    Does this sound like something which would be simple to achieve using Easy Touch?
    Does Easy Touch work well with Java Script?

    Thanks for your time.

    Mark.
     
  7. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,154
    Hi markgize,

    EasyTouch informs you of gestures on the touch screen with messages (C # delegate), each message is sent with a parameter containing all the information.In your case, you'll just make your treatment without regard to select the object if there is one.

    However, the use of delegate is not possible in javascript. But EasyTouch 4, provided acomponent "EasyTouch Trigger" , which allows you to call your own function based on EasyTouch events. You just need to move the plugins directory in the root of your project, as shown in the Unity documentation for using C # classes in javascript.

    A video showing you the use of this component
     
  8. markgize

    markgize

    Joined:
    Jan 12, 2013
    Posts:
    7
    Thanks for the detail. Will proceed as you suggest.
     
  9. Hedgehog-Team

    Hedgehog-Team

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

    EasyTouch bundle 4.0.3 is available

    EasyTouch 4.0.3
    ===============
    - fixe twist gesture, in some cases the value of "TwistAngle" was false (due to rounding of the function Vector2DeltaAngle of Unity)

    EasyTouchContols 1.0.2
    ======================
    - The controls are properly unregister from the dictionary to their destruction.
     
  10. Darkling420

    Darkling420

    Joined:
    Apr 20, 2013
    Posts:
    27
    Horizontal Already Exists, Vertical Already Exists, Joystick Already Exists if using two joysticks.
     
  11. Hedgehog-Team

    Hedgehog-Team

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

    Yes, each controls have axes name properties,

    These names must be unique in the scene (as indicated in the documentation) if you want to use the ETCInput class.
    Otherwise, a warning indicates that this axis name is already exit. But if you don't use ETCInput class it does not matter.
     
  12. Unib0t

    Unib0t

    Joined:
    Jan 4, 2013
    Posts:
    14
    Hi Hedgehog Team,

    Could you please update the EasyTouch download in the Hedgehog store to the latest version? It is still on version 3.

    Thanks
     
  13. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,154
    We will do this update this after noon
     
  14. CoCoNutti

    CoCoNutti

    Joined:
    Nov 30, 2009
    Posts:
    512
    Hi @Hedgehog Team
    Is it possible to make the joystick appear at any position on the screen where the user touches?

    Thanks
     
  15. Hedgehog-Team

    Hedgehog-Team

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

    Yes it is, to do so, you must choose "Dynamic" on type property in inspector. After you have the choice between using a pre-defined area, or set you own area.
     
  16. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Reporting, ballrun scene is not working? The ball falls through on starting.

    Also, can you consider adding Flick gesture.
     
  17. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,154
    weird, I don't have this issue, can you increase the height of the ball ?

    What do you mean by flick gesture ?
     
  18. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,280
    Hi,

    Is there an easy way that i can use your asset on mobiles but in the editor i can switch fast between using mouse and keyboard but also to test the touch input use the touch ui (with the mouse).
    At the moment i can only use one solution easy but would like that your asset can be switched of fast so i can make fast tests in the editor with mouse and key´s.

    Also i found a strange situation in your fps demo example and that is that the touchpad sometimes rotate the camera or the player in the direction the camera is looking (so it´s z direction i think) and not only around the player´s y axis and his x axis. I can reproduce it if i use the mouse on the screen to simulate the touchscreen swipe fast to the top and then the player also he is restricted to not go over his rotation clamp angles is looking complete up side down and if i then swipe more in every direction i get rotations around the camera´s z direction.
     
  19. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,154
    Hi RandAIThor

    I do not understand what you expect by switch between touch ui & mouse in editor.Can you give me a real example of what you want to do ?
     
  20. Darkling420

    Darkling420

    Joined:
    Apr 20, 2013
    Posts:
    27
    When using a TouchPad with buttons, the TouchPad works but blocking the buttons. How did you accomplish this in the fps example? I set the touchpad swipeout but still blocking. Also, is it no longer necessary to have the EasyTouch script in the scene?
     
  21. Darkling420

    Darkling420

    Joined:
    Apr 20, 2013
    Posts:
    27
    Figured it out. I needed to add the canvas again. The previous version made an EasyTouchCanvas and the new version makes an EasyTouchControlsCanvas.
     
  22. Hedgehog-Team

    Hedgehog-Team

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

    Darkling420
    The new Unity UI uses the hierarchy order to know the first UI Element. Make sure the button is below the touchpad (Look at my hierarchy order).
     
  23. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
  24. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,280
    For example the fps demo.

    I use your asset to make it work on my ipad and it does that great.
    But then when i know it is working i have to test many other things (like enemy ai or landscape things) and i want to test them fast and that would be in the editor first so i wish there would be a solution to switch of all of the touch things so i can use my mouse and keyboard for fast playtesting (features that does not have to do with easytouch) and later on when they work i want then to switch them back on to test them again on the ipad.

    Testing everything with your asset on the ipad is importand but also slow and not necessary at all time.

    I think i have to do this almost by myself by coding (what i not good in) it like i want but one thing would be good that you maybe could include in your asset and that would be a simple switch to de/activate your asset.

    Or can you tell me how i could or should make it so it works best with your asset?
     
  25. Aurecon_Unity

    Aurecon_Unity

    Joined:
    Jul 6, 2011
    Posts:
    241
    Hi Hedgehog, I just purchased your asset and already have a working joystick and trackpad combination using Easy Touch Controls. I do, however, have two issues on the Android build (testing on the device itself):

    1) I have a joystick on the left, and a trackpad on the right - joystick controls camera translate, trackpad controls camera rotation. If I am touching the joystick and then I touch the trackpad, the camera flips around very quickly. Any time I lift my thumb from the trackpad and put it back down, the camera flips if I am also touching the joystick.

    If my left thumb is not touching the joystick, the trackpad works fine.

    2) If I enable 'Swipe Out' on the trackpad, if I am touching both the joystick and the trackpad I can alter the camera rotation by moving the joystick. It seems to think that that my left thumb on the joystick is the same as the right thumb on the trackpad?

    Item 2 is not a big deal as I can just disable Swipe Out, but item 1 is a deal breaker at this stage as it means I can't smoothly fly around using movement and rotation at the same time - the camera flips out of control all over the place.

    Thanks

    EDIT: On further testing it appears that you can touch and hold once inside the trackpad, then place a second touch anywhere on the screen and the camera rotates based on where this second touch is. Is this intended behavior? I don't have Swipe In or Out enabled, and I can't see anywhere else in the trackpad settings that might fix this.
     
    Last edited: Feb 19, 2015
  26. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    873
    Hi,
    Did the following:

    - Deleted the old version from my project
    - Imported the new version into my project
    - Right click on hierarchy view

    ...can not find the reference EasyTouch or EasyTouch Controls meaning i am not able to import to my project. It works in a new project.

    Tested all kinds of things to import the new version to my current project without success.

    Please help.


    Cheers
     
    Last edited: Feb 20, 2015
  27. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,154
    Hi all,

    RandAlThor
    I don't understand what you want, you want to use the virtual controls with keyboard ?

    mickyg
    What you want is much like the FPS example, have you the same problem with this example?

    pKallv
    Can you give me the exact error that appears in your console
     
  28. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,280
    http://forum.unity3d.com/members/hedgehog-team.36910/

    My problem is that i can not test my game with your asset when i am on my pc becouse i have no touchdisplay.
    So one solution could be to ad your asset in the end of the development but then, to test fast i again would like to switch of your asset on the pc and i ask you if there is a way to do this or if you please could ad this as a feature in a future update.

    I would prefer to use your asset from the beginning so i can test on the ipad if things that i thought can work on mobile.
    But to ad new features fast i want to switch off your asset, develope and test on the pc and if it is to a point i like i would like to switch on your asset again, make a build to the ipad and test them also there.

    I choose your fps example becouse there i have a problem to test it right in the editor.
    I can click on all buttons and also move the player but i can not rotate the player but if i want to test all my features i must have a solution to test also this for example so becouse i am sadly still no coder i ask you to add a simple solution to this problem if you can make this to make your asset more usefull not only for me.
    What i do not want is that there are ways around the problem for example i can rotate if i push button x while try to stear becouse in some situations it makes me to slow to reakt or becouse i hit the button i can not hit another button.

    I know english is not my main language so maybe that is the reason you do not understand me a second time but maybe it is becouse you rush over my text. So please read them carefully and i think you can understand what i want.

    There would also be another solution and that is that everything will work without switching something on or off by hand but automaticly from your code to check if it is running in the editor or on mobile for example.

    Then there is also the solution that i would prefer to combine the input solutions so i can use the touch things from your asset but also can use the mouse and the keyboard like this free asset do.

    https://www.assetstore.unity3d.com/en/#!/content/30111

    Then i just can use it and it does not matter if i am on pc, mac or mobile.

    If you again could not understand what i want i would like to ask the others to help here to explain it better if someone else understand my wish and maybe also like it.
     
    Last edited: Feb 21, 2015
  29. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    Have you tried the Unity Remote app?
     
  30. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,154
    RandAlThor
    I ask questions because when you are in Editor or PC mode, EasyTouch uses the mouse to simulate the touches, you have the Ctlr & Alt key to simulate a second finger. You don't need a touch screen. EasyTouch automatically detect the plateform to whether to use the mouse or the touch screen

    So I don't understand what you lack to test your application in editor mode.
    If it runs into editor mode, it will work on the final platform. What you ask is already implemented.

    I assume you've tried the examples, there is no extra code to make these EasyTouch example works in editor or on PC build. They only use EasyTouch code.

    Or you can enable Remote mode to test on your plateform without a final build


    So I ask the question again, what is missing you from the already integrated simulation?
     
  31. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    873
    Very quick answer, really good thanks :)

    I get no error messages the problem is that after i have imported the new version it seem like it is not recognized by the Unity editor (latest version), i am not able to find EasyTouch in any editor menu at all. I am following the manual.

    I never see EasyTouch when right click on the hierarchy view, or anywhere else.

    Can you describe in detail, including deinstalling the old version, how to upgrade so i can check that i have not done anything wrong.

    BTW, if i start a new project and import it works.

    Cheers
     
    Last edited: Feb 21, 2015
  32. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,154
    There is no specific procedure, as you say "if i start a new project and import it works."

    Have you try to close and reopen Unity after import the package ?
     
  33. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    873
    I have tested a lot of different variations with no luck.

    What is your recommendation in regards how to removing the old version?
     
  34. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,280
    @Hedgehog Team

    Did you tried your own demo in the editor?
    Can you for example run and stear at the same time?

    Edit:
    @OnePxl
    To be true in the beginning of remote 4 i got many problems and forget to use that on the pc but just tried it again and it worked (sometimes) ;) Thank you for the suggestion.

    @Hedgehog Team
    I just tried lean touch and it does the same like yours with aditional keys like strg and/or alt.
    Now that remote 4 is working at least some times i think i will use that.
    Maybe what i want is not possible?

    Can you please tell me how to ad the player into the slot when the player will be spawned from the scene before?
     
    Last edited: Feb 21, 2015
  35. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    873
    Feature suggestion 2D:
    When i place a number of sprites on top of each other and click, the "gesture.pickedobject" select the sprite in the bottom, i want the object on top. Wouldn't it be better if the object on top is selected or there is a linecast that return a list of objects to select from? An alternative is a property to select top or bottom.

    Just a suggestion :)
     
  36. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,154
    Hi all,

    RandAIThor
    In short, you want to assign keys to the axes of the various controls to use them simultaneously in Editor

    pKallv
    2
    D object picking uses the function GetRayIntersectionNonAlloc .Unity indicated in the documentation:
    The colliders will be placed in the returned array in order of distance from the start of the ray.

    I must need to add a parameter to choose to reverse the result array
     
    Last edited: Feb 22, 2015
  37. grimcat

    grimcat

    Joined:
    Jul 12, 2013
    Posts:
    34
    Hello =)

    Thanks for your work on this, it has been a huge help.

    I'm wondering is it possible to return a joystick to center in script or reset it?

    I ran into a little issue where I was still receiving input after unpausing my game and would like to make sure everything is centered before returning control to the player.

    In my present implementation, I'm de-activating the canvas that my ETC controls are members of, but I'm thinking that it might be one of my problems.

    Thanks for your help!
     
  38. Hedgehog-Team

    Hedgehog-Team

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

    Can you try to use ETCInput static function instead disable canvas

    ETCInput.SetControlVisible(string ctrlName,bool value)
    or
    ETCInput.SetControlActivated(string ctrlName,bool value)
     
  39. grimcat

    grimcat

    Joined:
    Jul 12, 2013
    Posts:
    34
    I was thinking of giving the SetControlActivated method a try. I'll give it a shot.

    Thanks!
     
  40. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,280
    @Hedgehog Team

    RandAIThor
    In short, you want to assign keys to the axes of the various controls to use them simultaneously in Editor

    I think so.

    I have also another question and that is how can i attach a player to the slot in a game where the player can customize his character in the beginning and then is spawned in a level before?

    Edit:
    I am interested to use another asset with your called rewired and want to know if your asset overwrite Unity's input manager?
     
    Last edited: Feb 28, 2015
  41. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,154
    RandAIThor

    - "how can i attach a player to the slot in a game"
    If you only use direct action, you can use ETCInput static function to assign your player,

    * ETCInput.SetAxisDirecTransform(string axisName, Transform value)
    * ETCInput.SetAxisDirectAction(string axisName, ETCAxis.DirectAction value)
    etc.. look at documentation

    or if you use event,you have to add no persistent listener to the UnityEvent.
    Code (CSharp):
    1. public class DynamicSub : MonoBehaviour {
    2.  
    3.     public ETCJoystick myJoystick;
    4.  
    5.     void Start () {
    6.         myJoystick.onMove.AddListener( CallBackExample );
    7.     }
    8.    
    9.  
    10.     void CallBackExample(Vector2 move){
    11.         Debug.Log( "Cool " + move);
    12.     }
    13. }


    -"I am interested to use another asset with your called rewired and want to know if your asset overwrite Unity's input manager?"

    EasyTouchControls has his own input manager class ETCInput. This allows you to easily migrate your existing scripts with a virtual control (look at folowing video )
    Use rewired will not bring you anything more, as did the same thing by creating an Input class.

     
  42. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,280
    Thank you Hedgehog Team for your answers.

    I just want to make this game for multiplatforms and wanting to use rewired mainly for pc and mac but want to have just one resource that is the reason i asked about it and at the moment i also try to use some of it´s special features to easily make different controller maps and layouts and hope this will work with yours too. I have a demo now and can test.
     
  43. Hedgehog-Team

    Hedgehog-Team

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

    As I already told you, EasyTouch Control has its own Input manager, and I don't think Rewired will be compatible, because it is a middleware based on Unity Input class.
     
  44. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    I found an issue. When I set Double tap detection to System, a double tap will call single tap event too. It does not happen when set to Time. Is that intended? Feels like a bug.
     
  45. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,154
    This is not a bug, lookt at release notes :

    EasyTouch 4.0.1
    ===============
    - NGUI compatibility mode works as EasyTouch 3.X
    - New parameter allow you to choose the double tap detection mode :
    By system : Double works as EasyTouch 3.X
    By time : Double tap is relative to a maximum time, On_Simple isn't firing during a double tap, but a delay is required before to send it.
     
  46. DevionGames

    DevionGames

    Joined:
    Feb 22, 2010
    Posts:
    1,624
    Hey i am currently updating my support package and i think there is a spelling mistake in "SetUICompatibily".

    Edit:
    Also in
    "GetUIComptability"
     
  47. Hedgehog-Team

    Hedgehog-Team

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

    Zerano
    Thank you, I will fixe it
     
  48. Tbaggi

    Tbaggi

    Joined:
    Aug 4, 2012
    Posts:
    13
    Hi, just purchased Easy Touch 4.
    I've added Easy Touch Prefab to have SimpleTap/Pinch/etc... gestures and I've added an ETC TouchPad to explore a map with gameobjects on it.
    Since I've added the TouchPad, I can't detect a SimpleTap but it works if I .enabled=false the Graphic Raycaster from my TouchPad Canvas but I need it to explore my map.
    Is there a way to use a full screen touchpad and Easy Touch gestures on a same scene?
    I'm sure I'm missing something, it's my first week with the newGUI system. ^^'

    Thanks for the help.
     
  49. Hedgehog-Team

    Hedgehog-Team

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

    By default EasyTouch is setup with Unity UI compatibility mode, it's mean that you don't receive event from easytouch when you do a touch over a UI element. You receive other message to inform you that you touch a UI element (look at UI example)

    To receive EasyTouch when you re over UI elemment, just desable Unity UI compatibility on the inspector
     
  50. Darkling420

    Darkling420

    Joined:
    Apr 20, 2013
    Posts:
    27
    virtualcontrolinput object is being created each time I run in editor but not being destroyed when stopping play mode. I had 37 of them in my scene until I realized it was bugging, can you check on this.
    If I use a joystick and dpad but deactivate one or the other, then vice versa it creates a new one in the scene.

    I tried to use it as setting dpad to activated false and visibla fgalse, but theres also a bug in there. Unchecking visible in dpad keeps it visible.
     
    Last edited: Mar 4, 2015
unityunity