Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    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,155
    Hi,

    Version 2.3 will be available soon. It will provide support for the UNITY REMOTE IOS ANDROID (Test on iPad Nexus7) .It will be even easier to debug your applications

    Thank you to Fulvio Massini for the support he has given us to implement this functionality



     
  2. relayOne

    relayOne

    Joined:
    Sep 28, 2012
    Posts:
    23
    "Enable unity remote" effectively shuts off mouse input. I would recommend removing this feature unless you can find a way to make it always work with the mouse. I spent a couple of hours debugging why none of the examples worked with the mouse.
     
  3. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Is it possible to create "buttons" with EasyTouch without attaching colliders to them?
     
  4. Hedgehog-Team

    Hedgehog-Team

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

    EasyTouch doesn't overwrite unity and the GUI button still react to the touch, so you can simply create a button from Unity GUI

    One solution is to get the position of the touch with the desired event (on_touchstart, on_touchup, on_simpletap etc), then a test if button contain the touch position.

    After I don't see any other alternative, even without mentioning EasyTouch
     
    Last edited: Oct 19, 2012
  5. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    For all, I made a small error in the 2.3, I enabled remote mode by default on all examples .... must disable to test with the mouse.

    I restored this situation today

    Thank you to Scoot back up this issue
     
  6. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    I think it would work only with a GUI Texture button, not with UnityGUI buttons(OnGUI).
     
  7. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Unity GUI natively manages the touches , you have nothing to do

    In the web player the buttons "main menu" button are made with GUI, and they're received the touches

    Code (csharp):
    1. // Back to menu menu
    2. if (GUI.Button( new Rect(412,700,200,50),"Main menu")){
    3.     Application.LoadLevel("StartMenu");
    4. }
     
  8. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Ok, thanks.
    The problem is UnityGUI buttons don't work with multitouches, or several touches-buttons at the same time, but, yes, they can work in menus. Thanks.
     
  9. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    In this case ,t here are only two solutions:
    1- Add collider
    2- Test touch position as a function of the button rect
     
  10. berney

    berney

    Joined:
    Sep 11, 2012
    Posts:
    10
    Hi,

    I have this strange bug with ET 2.2. I attached the script to a prefab, I set all properties in the editor as I desire, mainly: 'Enable Easy Touch = True', 'Enable Auto Select = True' and 'Pickable Layers = Everything'. Once I run the game, all runs well. When I close Unity and reopen it, the touches don't work correctly for this object. Debugging this shows that the gesture.pickObject in the On_TouchStart event always return NULL although all settings on the GameObject are correctly set. Digging in your script at runtime (mind me for doing so...) I found that the 'autoSelect' property is always false, that's ofcourse in contrast to the settings in the editor.

    Do you have any idea?

    BTW, if I remove the script and add it again, it will work.

    Eyal
     
  11. Hedgehog-Team

    Hedgehog-Team

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

    First may update your EasyTouch version to 2.3.1

    Actually it is very strange,Do you have this kind of problem with the examples who are come with easytouch ? (Attention in 2.2, I left enable the remote option to true , set to false)

    Could you send me your sample project at the.hedgehog.team @ gmail.com (It will be easier for me to help you), and give me your msn or your skype

    Nicolas
     
    Last edited: Oct 21, 2012
  12. berney

    berney

    Joined:
    Sep 11, 2012
    Posts:
    10
    Thanks Nicolas.

    I cannot send the project as its under NDA. I will try to create a sample out of it that illustrate the bug. Today, I will also update to 2.3. I will update afterwards.

    Eyal
     
  13. jcmiguel

    jcmiguel

    Joined:
    Sep 30, 2012
    Posts:
    6
    I have implemented an orbit cam with easytouch and works flawless. However, I also have some NGUI panels which I use for setting up the scene (it browsers and selects a number of objects). The problem is related to specify when/where swipe should be enabled. I have ngui only working on the panels but easygui also affect the panels. They are in different layers. Is there any way to limit swipe into an area or disable it when panels are up?
    Regards
     
  14. Hedgehog-Team

    Hedgehog-Team

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

    You can't limit the swipe into an area, but you have 2 solutions for your issue :

    1 - If you don't need EasyTouch when the panel is up, you ca use the static methods :
    static void SetEnabled ( bool enable )

    This method enables or disables Easy Touch ... you can simply write this line of code

    To enabled
    Code (csharp):
    1. EasyTouch.SetEnabled(true);
    To disabled
    Code (csharp):
    1. EasyTouch.SetEnabled(false);
    There are a lot of static methods to control EasyTouch (look at the documentation).


    2 - Or another solution, is to test if the touch is in this area, you can do this when you receive the swipe event, and before action that you want to do.
     
    Last edited: Oct 31, 2012
  15. sh0v0r

    sh0v0r

    Joined:
    Nov 29, 2010
    Posts:
    325
    I am having this same problem, latest version 2.3.
     
  16. Hedgehog-Team

    Hedgehog-Team

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

    I will not ask the same questions, and I guess everything works correctly with examples.

    The Eyal's problem came from there were several EasyTouch script in the same scene. Look in your scene if you do not have several EasyTouch script.

    You must have only one EasyTouch by scene.

    If the problem continues, even punishment :D Can you send me a sample project with the bug.

    In the next version, (2.5) I added a menu that allows you to create EasyTouch gameobject, and especially it verifies that there isn't one already present. This version is pending acceptance at Unity

    And above there is also the virtual joystick ... look at this Here

    I await your return on your problem ...
     
    Last edited: Nov 6, 2012
  17. sh0v0r

    sh0v0r

    Joined:
    Nov 29, 2010
    Posts:
    325
    There is only one EasyTouch script in my scene.

    I am essentially creating a Game Controller setup like the example.
    All my buttons are on the correct layer and have colliders.
    Auto Select is set to the correct layer.
    My events handlers are setup and are working.

    Code (csharp):
    1. public void On_TouchStart(Gesture gesture)
    2. {
    3.         Debug.Log("On_TouchStart");
    4.  
    5.         GameObject pickedObject = EasyTouch.GetCurrentPickedObject(gesture.fingerIndex);
    6. }
    pickedObject is allways 'null'

    My games MainCamera and my GUI camera are separate with the GUI camera set to depth only and only culls the GUI layer with a higher depth order than the game camera.

    I am suspect that the 'pixelToWorldPoint' raycast maybe getting confused with this when testing for the GUI layer in the GUI camera.

    pickedObject will come back with player if I set the AutoSelect to player which means it is finding objects in the MainCamera.

    [EDIT]

    Yep here's the problem here: Ray ray = mainCam.ScreenPointToRay( screenPos );

    I modified the EasyTouch GetPickeGameObject method so it tests the gui camera first:

    Code (csharp):
    1.  
    2. private GameObject GetPickeGameObject(Vector2 screenPos)
    3. {
    4.     // Modified to test GUI camera first
    5.         Ray ray = guiCamera.ScreenPointToRay( screenPos );
    6.         RaycastHit hit;
    7.  
    8.         if (Physics.Raycast(ray, out hit, float.MaxValue, pickableLayers)) return hit.collider.gameObject;
    9.        
    10.         // Made it here so lets test the main camera
    11.         ray = mainCamera.ScreenPointToRay(screenPos);        
    12.  
    13.         if (Physics.Raycast(ray, out hit, float.MaxValue, pickableLayers)) return hit.collider.gameObject;     
    14.        
    15.         return null;               
    16. }
    17.  
     
    Last edited: Nov 6, 2012
  18. Hedgehog-Team

    Hedgehog-Team

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

    Actually it should probably be a delirium between two cameras, especially if you ask all the layers ...Can you build me a small package of your example, I watch it in my home. You can send this package to the.hedgehog.team@gmail.com

    You do not have to use the method EasyTouch.GetCurrentPickedObject (gesture.fingerIndex), but gesture.pickObject
     
  19. sh0v0r

    sh0v0r

    Joined:
    Nov 29, 2010
    Posts:
    325
    I've solved the problem, maybe you could add an option to add an array of cameras to the auto select section, tested in the order they are added.
    Using multiple cameras is a common method for setting up a GUI.

    Also thanks for the tip about gesture.pickObject!
     
  20. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    I had thought to add more camera, you confirmed in me my idea.

    I'll wait for validation 2.5 with EasJoystick to see if there is some bug reassembled. And I would add this feature in 2.6.

    Thank
     
  21. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,042
    I sort of had a similar problem, but a little different. I don't have multiple cameras at once, but the scene starts with a different camera for intro/menu area then switches to a gameplay camera. My solution was easier because I don't need the touch classes during the intro. I just started with it disabled, then enabled it once the game camera was the primary camera.

    The active camera is set and stored when easytouch is enabled. I added a method to update which is the active camera at any given point. Though it would be great if in addition the above multi camera, setting cameras were part of the base package.

    BTW, great tool! I rarely use any 3d part packages, but EasyTouch is robust and cleanly written.

    ZG
     
  22. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    thank you for the compliment, and I take into account your remarks to the 2.6, and especially don't hesitate to leave us reviews on the store, it's always nice


    I also have a good new version 2.5 of EasyTouch with Easy Joystick is released.

    EasyJoystick allow you to create a virtual joystick in few secondes ...
    2 new WebPlayer here and here

    Simpler than a long explanation, here are two videos showing you the possibility of joystick (hd mode is better) (sorry for my english)
    Integrating charactercontroller


    some parameter of EasyJoystick (it was the alpha version)



    Code (csharp):
    1.  
    2. /// Release notes V2.5 November 2012
    3. /// =============================
    4. ///     * EasyJoystick
    5. ///     --------------
    6. ///     - First release of EasyJoystick
    7. ///
    8. ///     * EasyTouch class
    9. ///     -----------------
    10. ///     - Add static method IsRectUnderTouch : to get if a touch is in a rect.
    11. ///
    12. ///     * Inpsector
    13. ///     ------------
    14. ///     - New inspector style for pro  free skin
    15. ///     - Add hierarchy icon to identify EasyTouch gameObject
    16. ///
    17. ///     * Gesture class
    18. ///     -----------------
    19. ///     - Add method IsInRect( Rect rect) that return true if the touch is in the rect.
    20. ///
    21. ///     * Bugs fixed
    22. ///     ------------
    23. ///     - Fix 2 static methods that didn't properly reference the  EasyTouch instance
     
  23. outtoplay

    outtoplay

    Joined:
    Apr 29, 2009
    Posts:
    741
    Terrific Product! I look forward to working with it in my latest project. I have a few questions specific to my current project. I'm creating a 2d Side Scroller. The controls are pretty simple, one joystick, that controls the Bird's movement to the left, and up and down. I like the idea of having a bit of inertia and that seems pretty easy with your product. But here are my questions.

    1 - When the player releases the joystick, I'd like the bird to return to a default Y position (height). This would allow them to swoop up to collect items and then return to a default flying altitude.

    2- Is it possible to limit movement on the X axis to forward? I'd like the character to be able to fly forward(positive x), but not in reverse(negative x).

    3- Is it possible to use physics (gravity), with a character (or cube...anything), and your joystick? So let's say instead of returning to a default Y value when the player let go of the joystick, it began to fall into the ocean, or ground or whatever was at the bottom of the screen.

    Hopefully this makes sense. I've attached a simple mockup image.

    Thanks for making a wonderful product!
    Brendan G.

     
  24. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    ... error
     
    Last edited: Nov 9, 2012
  25. Hedgehog-Team

    Hedgehog-Team

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

    EasyJoystick with EasyTouch allows you to interact with objects with four different methods:
    1 - Direct:
    EasyJoystick is going to controlling the object with parameters
    2 - Event:
    EasyJoystick sends a message to notify that the joystick is moving with a class parameter.
    3 - Include:
    You integrate an EasyJoystick object as a parameter in a scrip,t to directly access the values of the joystick
    4 - Direct Event:
    Combination of direct mode event

    For all your needs I would use Direct Mode Event.
    Wit the direct control shall regulate the speed of the inertia etc ...

    And Event Part (so by script) I managed self-stabilization and gravity effect, and axis limiter.
     
    Last edited: Nov 9, 2012
  26. outtoplay

    outtoplay

    Joined:
    Apr 29, 2009
    Posts:
    741
    God I hope this answer was not for me, cause it made no sense to me.
    If it was for me, any chance you could put that in more descriptive / helpful terms?

    B.




     
  27. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Yes it's for you Outtoplay... If you have a Skype, I can show you on my computer... (My English it's very bad ...)
     
  28. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    For outtoplay , I will try to give you more explanation...Anything you want to do is feasible, but not necessarily without programming.

    With EasyJoystick you can move, rotate etc ... somes gamesObjects without a lines of code, it's DIRECT mode. You just have to assign the object to the axes and indicate the action (translate, translate local, rotation etc ...), and the affected axis (x, y, z) over the parameters of speed, 'inertia etc ...

    However, some people prefer to have total control, so easyjoystick can also send events to notify you that the joystick moves (accompany different value). This mode is EVENT. But in this case, is yours any code as you would with the class INPUT

    EasyJoystick allows a mix of EVENTand DIRECT mode , which allows you to quickly implement moving your character, and with the event you can do
    everything

    To answer your 3 questions, I would use direct mode to move your bird, and I use the event with script to manage :
    - return to a default flying altitude
    - to limit movement on the X
    - and the gravity
     
  29. outtoplay

    outtoplay

    Joined:
    Apr 29, 2009
    Posts:
    741
    Have to say. This is a wonderful product and a very helpful and dedicated developer. Really helped me out, and now I can move forward with my prototype.

    Thank you Nicolas!
    Brendan G.
     
  30. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    You're welcome
     
  31. jphales

    jphales

    Joined:
    Nov 15, 2012
    Posts:
    7
    Hello Hedgehog Team,

    This tool and examples are awesome! Love it.

    //Problem (In JS)
    I would like to get the gesture.pickObject attribute out of my broadcast message without being forced to broadcast to the selected obj.
    (More specifically, I would like to be able to select layers included in the raycast without being forced to auto-select and broadcast to selected objects)

    I have a single eazy touch manager that I want to broadcast all my messages to. I do not want to use the auto-select and broadcast to individual objects. I can't select which layer(s) to include in the raycast if I don't check auto-select. So, I can get all other attributes and functions from my gestures but the gesture.pickObject pumps out NULL.

    Is there a way to do this?

    Thanks!
    Jon
     
  32. danien

    danien

    Joined:
    Jun 16, 2009
    Posts:
    71
    I'm interested in using this for handling touch/mouse events for my game objects so I'd like to see how that's done using your plugin before buying.

    Is there a link to the documentation I could check out? The Dropbox link on your website is broken. Thanks.
     
  33. Hedgehog-Team

    Hedgehog-Team

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

    Here a new link to the documentation
     
  34. Hedgehog-Team

    Hedgehog-Team

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

    For jphales :

    You can redirect all EasyTouch messages to a single gameobject, by using the static method SetOtherReceiverObject (gameobject receiver).

    Add this call in the Start method "EasyTouch.Set Other Receiver Object (myObject)" in a new script, and gameobject "myObject" will receive all messages, there is or is not self selection

    You can disable the auto selection in the EasyTouch inspector
     
  35. jphales

    jphales

    Joined:
    Nov 15, 2012
    Posts:
    7
    Thank you Nicolas,

    I remember coming across that in the documentation, but was unsure how it would help since I'm already catching all broadcasts with the default gameObject my easy touch is connected to - and wasn't giving me gesture.pickObject.

    I will try it out today when I get in.

    Great library! Well worth the purchase.

    Thanks,
    Jon
     
  36. danien

    danien

    Joined:
    Jun 16, 2009
    Posts:
    71
    Thank you.
     
  37. jphales

    jphales

    Joined:
    Nov 15, 2012
    Posts:
    7
    Hi Nicolas,

    I see, there is no raycast unless auto-select is turned on - which is why pickObject was always NULL.
    Then, I can route the message wherever I want with SetOtherReceiverObject.

    I am grateful for this cool little library. A real time saver.
     
  38. theprojectabot

    theprojectabot

    Joined:
    Nov 11, 2011
    Posts:
    38
    Im currently having an issue with EasyTouch.

    I have a button system setup. They respond correctly to taps in one scene I have but when I bring the system over to a new scene the pickedObject is null.

    I have verified that the gui prefab I have setup works in my previous scene. ( character jumps and such)
    I then prefab'd the game object that contains my EasyTouch game object, bring it over to the new scene. Bring the gui prefab to the new scene. Start up the scene and find that the log statements I placed in the delegate callbacks(in my character game object) dont have any picked object. Its always null.

    In my character game object in the OnEnable() override I made sure to put a log statement to make sure that the callbacks are being added to the EasyTouch delegation system.

    Indeed I get: Enabled the touches
    UnityEngine.Debug:Log(Object)

    I also put a log in the
    On_TouchDown override in my character
    that is also called, however the gesture is null.

    Why? Im so confused here.... it works in my other scene with all the same componenets... what am I doing wrong?

    I have made sure that my right and left controls are on the correct layer(UserInterface) and that the camera looking at the controls is the MainCamera... totally confused here.

    why is my pickObject null????

    I am using loadleveladditiveasync and everything thing seems good to go except for the easy touches.
    The player script is boot loaded when the second scene loads and I make sure that OnEnable is fired.... adding the delegates...
     
    Last edited: Nov 21, 2012
  39. Hedgehog-Team

    Hedgehog-Team

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

    If you use a Unity GUI item , it is normal pickObject is null, because the Unity manages natively the touches

    If it is not a GUI object :
    Have you properly configured the collision layers, and add a collider?
    Have you activated the self-selection?

    Otherwise you could send me your scene so that I can look

    Nicolas
     
  40. relayOne

    relayOne

    Joined:
    Sep 28, 2012
    Posts:
    23
    Is there a way to disable the double-tap feature? I would like users to be able to tap objects repeatedly, and I would like to continue receiving the event notification for a single tap.
     
  41. Hedgehog-Team

    Hedgehog-Team

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

    I'm sorry, there is no way to disable the double tap. But have you tried with Touchstart?

    Nicolas
     
  42. hong88

    hong88

    Joined:
    Dec 10, 2012
    Posts:
    14
    hi Hedgehog Team,

    I just brought your product. I would like to know how can i determine the strength of swipe ?
     
  43. Hedgehog-Team

    Hedgehog-Team

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

    You have at your disposal the Gesture class that contains several information about the gesture in progress.

    If you want to calculate the strength of swipe, you can intercept the message On_SwipeEnd, then calculate the force with members actiontime swipeLength class gesture.

    Nicolas
     
  44. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Bought! Because of your EasyJoystick! :D
    Marvelous package! Seems to be easy to use.
     
  45. Hedgehog-Team

    Hedgehog-Team

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

    I hope it suits you, it is only version 1.0 of Easy Joystick, it will improve with age
     
  46. Ghopper21

    Ghopper21

    Joined:
    Aug 24, 2012
    Posts:
    170
    Hi Hedgehog Team -

    I'm considering using Easy Touch.

    I need to be able to support multiple users simultaneously making multifinger gestures. Is this possible with Easy Touch?

    Thanks.
     
  47. Hedgehog-Team

    Hedgehog-Team

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

    Yes you can, but Easytouch doesn'tt include multi-player, just multi touches in the same times. It is up to you to manage the multi-player.
     
  48. hong88

    hong88

    Joined:
    Dec 10, 2012
    Posts:
    14
    Hi Hedgehog Team ,

    Me again....I wanna ask problem using your script over the network ....
    Will I still receive the event called if the object is not owned by this player?
    Detail :
    I 'm doing a game like ping pong ... 2 player object and a scene object -ball.
    To optimize physic on game object, I let the first player to be the owner for both player object.
    I only receive the input from second player and send to the first player to perform physic .
    The problem situation is when i build the game,
    Situation 1:
    1st player on standalone version and 2nd player within unity3D .
    2nd player on unity3D cannot perform any touch function.

    Situation 2:
    1st player on unity3D and 2nd player within standalone version.
    1st player 2nd player perform touch function perfectly.
    unity3d version is 4.0 .0 f7
    What i thinking is the event over the network? Isn't any way i can solve it?
    Thanks for any advise...
     
  49. Hedgehog-Team

    Hedgehog-Team

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

    I didn't understand everything, but EasyTouch doesn't work across the network is a local library because it manages to physically touch screens.

    It is for you to transfer actions on the touch screen to synchronize the two players. If you code an action on the Enter key with the class INPUT, this action is not sent across the network, it is the same with EasyTouch.

    Otherwise you would have an example?
     
  50. Frozmat-Games

    Frozmat-Games

    Joined:
    Dec 17, 2012
    Posts:
    25
    Just Bought it. Really nice tool. Thank you.)

    Any chance to get some javascript examples? Documentation is good but not for beginners....(

    I can't call Swipe function from javascript for some reason... all others work fine.
     
    Last edited: Dec 17, 2012