Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    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

    It's very difficult because twits and pinch are very simular, so you must play with min pinch length and min twist angle on inspector
     
  2. edaw22

    edaw22

    Joined:
    Aug 20, 2012
    Posts:
    14
    Hi there Nicolas.

    I have a question that I really need help with.

    I have a game in development that is using your Easy Touch and Easy Joystick addons. I am also using the NGUI addon.

    I have 2 dynamic joysticks in the game each limits to half the screen each. One handles player movement, the other handles moving the camera, a tap to jump and various swipes for special abilities.

    I would really love to know how to disable the joysticks when I a touch is over a GUI item. I have no idea how to do this and Ive been going through some of the documentation but im still bnot quite sure how to go about it. I think I should be fine disabling the joysticks when the game is paused as I have a checkable state for this. However Im not sure how to go about doing it for just regular HUD buttons while the game is running.

    Any help would be much appreciated.

    Regards,
     
  3. edaw22

    edaw22

    Joined:
    Aug 20, 2012
    Posts:
    14
    I finally found the NGUI compatibility option after failing to notice them in the inspector and documentation haha.

    All good Nicolas, problem solved :)
     
  4. Remiel

    Remiel

    Joined:
    Oct 17, 2012
    Posts:
    103
    I've noticed a potential bug.
    I'm using Easy Joystick, everything is set up correctly and working fine.
    However when joystick is used to move the player to a point where the next level loads (not Async load but regular load), since the load can take awhile, player lets go of the joystick. When the next scene loads Easy Joystick didn't register that the player let go of it in the previous scene and is still moving the player in the previous direction, until the player puts his finger on the joystick and it registers the finger again.
     
  5. Nosferatu

    Nosferatu

    Joined:
    Nov 15, 2013
    Posts:
    18
    Can I use a non square texture for a joystick? When I run a texture 512x128 it prints to the screen as 512x512.
     
  6. Hedgehog-Team

    Hedgehog-Team

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

    Edaw22
    Ok

    Remiel
    Do you use "don't destroy on load",or there is a new EasyJoystick and EasyTouch on the next level ?

    Nosfertu
    You can only use sqaure texture, may be you can try with a square texture with alpha arrount your no square
     
  7. Remiel

    Remiel

    Joined:
    Oct 17, 2012
    Posts:
    103
    There is a new Easy Joystick and Easy Touch on the next level

    EDIT:
    but I've tried don't destroy on load too and the same thing happens
     
    Last edited: Dec 15, 2013
  8. Remiel

    Remiel

    Joined:
    Oct 17, 2012
    Posts:
    103
    Bump?
    I really need this fix!
     
  9. Hedgehog-Team

    Hedgehog-Team

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

    I'm soryy I wasn't at home this week.

    I'm going look at that week end, do you have skype account ?
     
  10. windwalking

    windwalking

    Joined:
    Jun 28, 2013
    Posts:
    2
    Hi,

    I am having a problem with instantiated prefabs at runtime. I want the prefabs I am creating at runtime to respond to taps and so I have a script that adds the event tap to the prefab itself and I only change a few variables while instantiating. What happens is when I tap one prefab, all other prefabs register the tap and fire up their respective functions. Is there a way to make only the tapped prefab object's function fire up and not the rest?
     
  11. Dunkelheit

    Dunkelheit

    Joined:
    Sep 3, 2013
    Posts:
    81
    I have a question.

    How can I resize a joystick texture? I've made a custom texture to replace the EasyTouch joystick one, but when the image is rendered in the game, it fits width and height with the same size, but it suppose to be larger than higher, I want more width than hight. How can I accomplish it?

    Thanks.
     
  12. Remiel

    Remiel

    Joined:
    Oct 17, 2012
    Posts:
    103
    I sent you a PM earlier today.
     
  13. Dunkelheit

    Dunkelheit

    Joined:
    Sep 3, 2013
    Posts:
    81
    Is it possible to custom the joystick image size to not stretch both hight and width?
     
  14. Hedgehog-Team

    Hedgehog-Team

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

    Remeil
    I add you to my skype, I 'm waitting that you accept me.

    Dunkelheit
    you can't. But you can try to create a texture with alpha on border
     
  15. Dunkelheit

    Dunkelheit

    Joined:
    Sep 3, 2013
    Posts:
    81

    So is it possible to avoid joystick configuration and use 2 buttons instead? Can I slide down my fingers with these two buttons to emulate a joystick?
     
  16. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Yes , you can wiht EasyButton . But don't forget to set to true swipe in option for each button
     
  17. Mikie

    Mikie

    Joined:
    Dec 27, 2011
    Posts:
    367
    Does EasyButton work at all with 4.3.2. When I publish an app to my Droid 2 it locks up the Droid. 4.2.2 worked. I have the latest version of EasyButton. I thought the droid was bricked.
     
  18. Hedgehog-Team

    Hedgehog-Team

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

    As i saied EasyTouch uses Unity API, it's working fine for me on my nexus 7

    Do you have this issue with the examples that come with EasyTouch ?
     
  19. Kellyrayj

    Kellyrayj

    Joined:
    Aug 29, 2011
    Posts:
    933
    Hi Nicolas,

    I am attempting to return the touch position with the GetFingerPosition thing. This is what I have so far but can't seem to get past some compiling errors.

    Am I in the ballpark? Or totally way off?

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class PlayerControls : MonoBehaviour {
    5.  
    6.  
    7.     public static int fingerIndex;
    8.     public static Vector2 position;
    9.     public static Vector2 deltaPositon;
    10.  
    11.  
    12.     void OnEnable(){
    13.        
    14.         EasyTouch.On_Cancel += On_Cancel;
    15.         EasyTouch.On_TouchStart += On_TouchStart;
    16.         EasyTouch.On_TouchDown += On_TouchDown;
    17.         EasyTouch.On_TouchUp += On_TouchUp;
    18.  
    19.     }
    20.  
    21.  
    22.     static void GetFingerPosition(int fingerIndex){
    23.  
    24.     }
    25.  
    26.     private void  On_Cancel( Gesture gesture ){}
    27.    
    28.     private void  On_TouchStart( Gesture gesture ){}
    29.    
    30.     private void  On_TouchDown( Gesture gesture ){}
    31.    
    32.     private void  On_TouchUp( Gesture gesture ){}
    33.  
    34.  
    35.  
    36. }
     
  20. Lockwood

    Lockwood

    Joined:
    Dec 24, 2013
    Posts:
    5
    Hey dev,

    Is there anyway to try it out before buying it? also what's the difference between the one in your site and the one in the asset store?
     
  21. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    909
    you can buy closed eyes !
     
  22. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
  23. Mikie

    Mikie

    Joined:
    Dec 27, 2011
    Posts:
    367
    Yes, I used your examples with 4.3.2 and they all locked up my Droid. Before 4.3.1 they all worked. I need to check the date on the apk file.
     
  24. jococo

    jococo

    Joined:
    Dec 15, 2012
    Posts:
    232
    Is there a toggle button and throttle stick yet with Easytouch?

    If not does anyone have any ideas how to do a toggle button or throttle stick?
     
  25. Hedgehog-Team

    Hedgehog-Team

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

    It's possible to create a toggle button, for that you need :

    - manage a boolean that you switch each time you pressed the button
    - Change the button texture relative to this bool

    For the trholle, it 's not possible with out modify Easyjoystick, but it's a good idea for a new feature
     
  26. hdd-op

    hdd-op

    Joined:
    Dec 30, 2013
    Posts:
    5
    Hi , I have input code like this
    Code (csharp):
    1.  
    2. public EasyJoystick myJoystick;
    3.  
    4. .....................
    5.  
    6.     public static bool SendInput (CarControl Car, bool reverseRequiresStop, bool brakeRelease)
    7.     {
    8.         float steerValue = Mathf.Clamp (Input.GetAxis ("Horizontal"), -1, 1);
    9.         float forwardValue = Mathf.Clamp (Input.GetAxis ("Vertical"), 0, 1);
    10.         float reverseValue = -1 * Mathf.Clamp (Input.GetAxis ("Vertical"), -1, 0);
    11.         float handbrakeValue = Mathf.Clamp (Input.GetAxis ("Jump"), 0, 1);
    12.  
    13. ............
    14.  
    get error if I set value to to myJoystick.JoystickAxis.x
    An object reference is required to access non-static member `CarMain.myJoystick'
     
  27. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Hi Hdd-op,

    What do you want to do ?
     
  28. hdd-op

    hdd-op

    Joined:
    Dec 30, 2013
    Posts:
    5
    hi , I can not use public var myJoystick in public static bool SendInput and replace input.getAxis
     
  29. Hedgehog-Team

    Hedgehog-Team

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

    It's normal, because you can't referer a no static variable in a static method...
     
  30. isacan

    isacan

    Joined:
    Jul 18, 2013
    Posts:
    37
    Hello,

    How can use camera swipe and rotate my car ? can you have any demo or example
     
  31. hdd-op

    hdd-op

    Joined:
    Dec 30, 2013
    Posts:
    5
    hi so how in easy way I can make something work ?:)
     
  32. jococo

    jococo

    Joined:
    Dec 15, 2012
    Posts:
    232
    I see buttons change texture in the inspector but not on the game.

    Something like this, yes?

    Code (csharp):
    1.  
    2. function leftHanded()
    3. {
    4. RightHandedButton.ActiveTexture = RightHandedButtonNoSelected;
    5. RightHandedButton.NormalTexture = RightHandedButtonNoSelected;
    6.  
    7. LeftHandedButton.ActiveTexture = LeftHandedButtonSelected;
    8. LeftHandedButton.NormalTexture = LeftHandedButtonSelected;
    9. }
    10.  
    Where LeftHandedButtonSelected, etc are the texture variables.

    Similar function for right hand.

    Anything else I need to get this to work?

    Simply is not working.
     
  33. Hedgehog-Team

    Hedgehog-Team

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

    Happy new year

    hdd-op :
    If you want something work, you must explain to me what you want to do.
    You want to replace Input get axis by joystick

    jococo
    Give me 1 or 2 days, I'm going to make a toogle button example
     
  34. hdd-op

    hdd-op

    Joined:
    Dec 30, 2013
    Posts:
    5
    Hey! Hedgehog Team New Year's day 2014 is here! Put on your party hat and raise a toast to good times. !!!!

    Yes I need to replace input axis in car input script , now I was searching in car physic engine where I can find car sterling values .
    and discovered they are .


    Code (csharp):
    1.  
    2. public class CarControl : MonoBehaviour
    3. {
    4.     public float steerInput = 0.0f;
    5.     public float motorInput = 0.0f;
    6.  
    7. .....
    8.  
    9.  
    So i need to set EasyJoystick to this public float values .. maybe by replacing axis values in first input script or just directly assign this values to car control script .

    Thanks for any help and advise .
     
  35. jococo

    jococo

    Joined:
    Dec 15, 2012
    Posts:
    232
    Happy New Year to you also Hedgehog Team! :)

    A tutorial would be nice but if you can just verify that my code is correct I can try to work on it a bit.

    Bonne année à vous aussi Hérisson d'équipe! :)

    Un tutoriel serait bien, mais si vous ne pouvez vérifier que mon code est correct je peux essayer d'y travailler un peu.
     
  36. Hedgehog-Team

    Hedgehog-Team

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

    Isacan
    Do you use C# or Javascript

    hdd-op

    Code (csharp):
    1. public class CarControl : ManoBehaviour{
    2.    
    3.     public EasyJoystick myJoystick;
    4.  
    5.     private float steerInput;
    6.     private float motoInput;
    7.  
    8.  
    9.     void FixedUpdate(){
    10.        
    11.           if ( myJoystick.joystickAxis.y>0){
    12.                       motoInput = myJoystick.joystickAxis.y;
    13.           }
    14.  
    15.          ....
    16.          ....
    17.        
    18.     }
    19. }

    jococo
    Yes it is. Your code seen to be ok for swipping texture
     
  37. isacan

    isacan

    Joined:
    Jul 18, 2013
    Posts:
    37
    I use C#

    Isacan
    Do you use C# or Javascript
     
  38. ritual

    ritual

    Joined:
    Sep 26, 2013
    Posts:
    5
    Hello,

    when will easy touch support 2d colliders.?

    will it be a new version I have to buy or will it be a free update.?
     
  39. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    405
    I registered for the forum (as user ferretnt) and although I recieved a message on Dec 29th saying my registration was being reviewed, I've never been approved.

    I'm porting from FingerGestures to EasyTouch right now, and this needs to be finished in the next 2 weeks (or else we have to stick with FingerGestures for our next app.)

    My question: When "Auto select" is selected, I'm not getting any swipe gestures. I can prove this by disabling auto-select at runtime, at which point my callback is immediately called. All of my world is enclosed in colliders, so it shouldn't be because raycasts are missing, but even so, the swipe is for a pure UI gesture interface, so is there a way I can have "auto select" enabled, but just recieve all raw swipe gestures, whether they hit an object or not?

    Thanks,
    Alex
     
  40. Hedgehog-Team

    Hedgehog-Team

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

    Ritual
    The version that supports 2D collider is soon ready. Like all other updates will be free.

    I purposely waited because former users reproach me it is too ready to follow the unity version and some bug fixes were forced to migrate to the new version of Unity.

    I think the new version will be available within 2 weeks

    Isacan
    I'm waiting for you on Skype

    Ferretnt
    Can you give your User Name and Email when your asked to be register on our forum.

    All your world is enclosed in colliders (All your worl can be selected by touch ?), but If you have user interface zones, I guess it shouldn't be any interaction with your world when the touch is in this area.

    Do you have your GUI on the same camera as your world ?
     
  41. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    405
    Yep, I registered on the forum as "ferretnt", with email "easytouch@nanuinteractive.com". I got the first reply, but not the confirmation.

    So, yes, all my world has colliders for various gameplay reasons, but I want to detect swipes independently, and use them for camera control (rotate left/right.) However, looking at the code, I'm now not sure this will do what I want. Previously, with FingerGestures, a "swipe" was a discretely recognized thing with minimum velocity. Whereas, it looks like EasyTouch is interpreting a drag that does not hit anything with the pick raycast as a swipe. In other words, any "swipe" in my environment will currently report a Drag, not a Swipe. Am I correct? If so, is there any way in Easytouch to detect "swipes", i.e. drags anywhere on the screen above some minimum velocity?

    The GUI is an NGUI camera, specified seperately under NGUI cameras in EasyTouch, in a different layer.
     
  42. Hedgehog-Team

    Hedgehog-Team

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

    Ferretnt
    Can you redo your entry because I do not find in the waiting.


    Yes, it's correct if you do a swipe over a pickeable object, EasyTouch returns to you a Drag

    What do you mean by velocity ? (distance / time )
     
  43. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    405
    Re-registered as ferretnt1, easytouch1@nanuinteractive.com. It wouldn't let me have the original emails. Then I found I could actually log in as ferretnt. Anyway, it's all good.

    For swipes, yes I'm assuming that the user will be dragging objects within the game world, but I want any high velocity drag to be interpreted as a "spin the camera 90 degrees" swipe. With FingerGestures I did this with a separate gesture recognizer, which explicitly only recognized drags with fast movement of finger per second. It sounds like an easytouch "swipe" is just a drag that didn't hit a pickable 3D object, so I need to do that manually?
     
  44. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
    Yes , you can calculate the velocity manualy , look at Gesture class that it passed for each event

    Becarfull (swipeLength member is only assign for a drag_end event)
     
  45. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    405
    Thanks - and thanks for the warning!
     
  46. ritual

    ritual

    Joined:
    Sep 26, 2013
    Posts:
    5
    oh ok.. cool. cant wait.
    are you still giving access to the beta version.? if we send you my email and invoice number..?
     
  47. Hedgehog-Team

    Hedgehog-Team

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

    EasyTouch 3.1.4 is available on Asset store :

    /// EasyTouch V3.1.4 January 2014
    /// =================================
    /// * New
    /// ----------------------
    /// - Add 2d collider support
    ///
    /// * Bugs fixed
    /// ------------
    /// Fixe gravity on character controler
    /// Fixe stiking joystick after a load level
     
  48. Mikie

    Mikie

    Joined:
    Dec 27, 2011
    Posts:
    367
    Does it work with 4.3.2? And a android phone.
     
  49. Hedgehog-Team

    Hedgehog-Team

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

    EasyTouch doesn't use external tools to manage touch, it's using Unity API.

    For me it's working fine on Nexus 7 (4.3 Jelly Bean) and on my Experia SP (4.1.3) . There is no reason why it does not work, if that is the case, it would come not EasyTouch, but incompatibility with Unity
     
  50. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,002
    I just upgraded to V3.1.4 from V3.0.3 and discovered you changed how the cameras worked.

    Can you please explain the expected flow for camera selection?

    To explain, I have a scene that has multiple cameras for different parts of the game. I switch between this cameras, only one is active at time. In the old version, I would just use SetCamera to point to the active camera so events weren't captured from the other cameras. In the current version, SetCamera continually adds cameras to the array of cameras and apparently check them all. So now, I get all events from all cameras even if they are disabled.

    It was an easy fix, I just modified SetCamera to replace touchCameras[0] with the current camera.

    But what is the expected flow for multiple cameras? I already have to make multiple edits to the easytouch stuff when you update it, but I would prefer to keep that at a minimum. How would I ensure that I only get events from a single camera that I choose instead of all cameras.

    Ideally if easytouch would simply ignore a camera that is not active that would be the best option. Or if you created a method like AddCamera that was separate from SetCamera rather than have it continually add new cameras.

    Thanks.