Search Unity

[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
    Ok, I will do it for the next update
     
    arkhament likes this.
  2. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    Also, have you changed the API for the joystick? With the newest update this no longer works. When I used to get the value of an idle axis I used cyclicStick.axisX.axisValue but now it always returns NaN.

    Edit: A bug in ETCJoystick causes this if BackgroundSize is set to 0. You should add a check or clamp to be sure its always >0 and using the component reset from the setting dropdown removes most functionality from the inspector but that's okay. The prefab revert fixes it.
     
    Last edited: Nov 10, 2015
  3. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    On another note, is there a way to clamp the joystick axis to 0, 1 instead of -1, 1?
    This seems to be ignored if (collectiveStick.axisY.axisValue < 0) collectiveStick.axisY.axisValue = 0; as I assume axisValue is read only.
     
  4. Hedgehog-Team

    Hedgehog-Team

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

    As stated in the read me Easy Joystick has been replaced and the new version is not compatible with it, as well as the methods to access the different value. These new controls have been introduced at the time of EasyTouch 4.X release compared to the new Unity UI (there soon 1 year)

    A new class allows management controls, I invite you to watch all the documentation and examples. You can look at this video where I 'm doing the migration with the new control
    .


    The axes are not designed to operate between 0 and 1, but between -1 and 1 as the axes managed by Unity to facilitate the migration of existing code
     
  5. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    I'm using ETCJoystick in Et 4.3.2, not EasyJoystick.and didn't migrate anything so I'm not sure what you mean. ETCJoystick.axisX and ETCJoystick.AxisY are part of the ETCAxis class according to your symbols, so...
    Axes can operate at 0, 1 by clamping to 0 if < 0 in Update. I just couldn't get the smoothing properly and so thought I would try ET again but seems I may as well spend the extra time getting my smoothing to work.

    Some of the uGUI code I've used in my own Joystick script:
    Code (CSharp):
    1.  
    2. public Vector2 jsAxis;//I create the jsAxis write access to control the joystick axis from another scriipt
    3. //then this allows for a joystick using uGUI
    4. public Vector2 JoystickAxis
    5.   {
    6.   get
    7.   {
    8.   Vector2 jsOutput = jsAxis.magnitude > deadZone ? jsAxis : Vector2.zero;
    9.   if (axes == Axes.Horizontal) jsAxis.y = 0; //freeze y axis
    10.   else if (axes == Axes.Vertical) jsAxis.x = 0;
    11.   return jsOutput;
    12.   }
    13.   set { SetAxis(value); }
    14.   }
    15. //and I call this method whenever I need to update the joystick on screen
    16. public void UpdateGraphics()
    17.   {
    18.   if (joystickGraphic)
    19.   joystickGraphic.localPosition = jsAxis * Mathf.Max(rectTransform.sizeDelta.x, rectTransform.sizeDelta.y) * .5f;
    20.   }
    21. //and to clamp the range to 0,1
    22. if (cyclicStick.jsAxis.y <0) cyclicStick.jsAxis.y = 0;//I call this in Update to keep the range at 0, 1
    23. //and call this to sync the graphics right after clamping the range
    24. UpdateGraphics();
    25.  
    26. //in my controller script
    27. public Joystick collectiveStick;
    28. if (collectiveStick.JoystickAxis.y != 0) rotorVelocity = Mathf.Lerp(rotorVelocity, collectiveStick.JoystickAxis.y, Time.deltaTime * inputMulti);
    29. //clamping done here
    30. if (collectiveStick.jsAxis.y < 0)
    31.   {
    32.   collectiveStick.jsAxis.y = 0;
    33. //sync the thumb with the actual value
    34.   collectiveStick.UpdateGraphics();
    35.   }
    36.  
    This works flawlessly in Project-uGUI, but I'm trying for the same results in an identical project Project-ET.
    Unless I've misunderstood you, and you have indeed removed the EasyTouchControls ETCJoystick as well.
     
    Last edited: Nov 11, 2015
  6. Hedgehog-Team

    Hedgehog-Team

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

    I had not realized that you read in live the values of ETCJoystick, without using the provided API. That's why I thought you are still using version 3.x

    Yes, definitely doable, but I have not designed axes management to make it work between 0 and 1.By intervening in the operation of the joystick from the outside, you go necessarily in conflict with the joystick & axis code itself. Because even if you set the value and you reposition the thumb, internal variales of the joystick & axes are still negative values.
     
  7. maidamedia

    maidamedia

    Joined:
    Nov 19, 2009
    Posts:
    224
    Is there an example with a single joystick on the left that manages both translation and rotation? thx
     
  8. Hedgehog-Team

    Hedgehog-Team

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

    do you mean a joystick that allow the player to rotate in the direction of the joystick, and move in the same time ?
     
  9. Hedgehog-Team

    Hedgehog-Team

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

    EasyTouch Bundle 4.4.0 is available on Unity AssetStore : http://u3d.as/2Uo


    EasyTouch Bundle 4.4.

    EasyTouch 4.1.1
    * Unity remote is activated automatically if needed
    * UNITY_IPHONE platform defines is replaced by UNITY_IOS
    * Lightmap data are removed.

    EasyTouchControls 1.2.6
    - News
    *You can choose to unregister or not a control at disabling time.
    * StandAloneInputModule composant is automatically add to the EventSystem gameobject.
    - Bug fixed
    *Change UNITY_IPHONE by UNITY_IOS
    *Second dynamic joystick no longer show when the touch come from another area in the editor mode
    * InputManager is automatically add in static (in the hierachy when you create a control)
     
  10. maidamedia

    maidamedia

    Joined:
    Nov 19, 2009
    Posts:
    224
    Yes
    Yes, a single joystick that at the same time can rotate both third camera and player orientation and also moves him forward or backward. I used once something like this and if I well remember if you press the joystick inside the centrall area it just rotates, instead if you also move the ball well outside the central area it also moves the player.
     
  11. Hedgehog-Team

    Hedgehog-Team

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

    This features isn't exit in direct mode, but can create it easyly with this method, that you call from event part of your joystick

    Drag and drop this script on your object
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class NewBehaviourScript : MonoBehaviour {
    5.  
    6.     public float speed = 10;
    7.  
    8.     public void My_JoystickMove( Vector2 axes){
    9.         float angle =Mathf.Atan2( axes.x,axes.y ) * Mathf.Rad2Deg;
    10.         transform.rotation  = Quaternion.Euler( new Vector3(0,angle,0));
    11.         transform.Translate( Vector3.forward * speed * Time.deltaTime, Space.Self);
    12.     }
    13. }
    And this script from On_Move event in the inspector
    upload_2015-11-25_17-2-29.png
     
  12. maidamedia

    maidamedia

    Joined:
    Nov 19, 2009
    Posts:
    224
    Ok thx, I will try it!
     
  13. smallUser

    smallUser

    Joined:
    Sep 18, 2013
    Posts:
    10
    Hi i want to make Smooth to your RTSCamera.cs
    But It doesn't work very well, because i am changing the way you use transform.Translate
    into Lerping transform.position.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class RTSCamera : MonoBehaviour {
    5.  
    6.     private Vector3 delta;
    7.     Gesture gestureOnSwipe;
    8.  
    9.     void OnEnable()
    10.     {
    11.  
    12.         #region TryToLerp
    13.         EasyTouch.On_SwipeEnd += On_SwipeEnd;
    14.         #endregion
    15.     }
    16.  
    17.     private void On_SwipeEnd(Gesture gesture)
    18.     {
    19.         //throw new System.NotImplementedException();
    20.         gestureOnSwipe = gesture;
    21.         StartCoroutine(SmoothStop());
    22.     }
    23.  
    24.     void On_Drag (Gesture gesture){
    25.         On_Swipe( gesture);
    26.     }
    27.  
    28.     void On_Swipe (Gesture gesture){
    29.         gestureOnSwipe = gesture;
    30.  
    31.         //transform.Translate( Vector3.left * gesture.deltaPosition.x / Screen.width);
    32.         //transform.Translate( Vector3.back * gesture.deltaPosition.y / Screen.height);
    33.  
    34.         #region TryToLerp
    35.         transform.position = Vector3.Lerp(transform.position, Vector3.left * gesture.deltaPosition.x , Time.deltaTime * .1f);
    36.         transform.position = Vector3.Lerp(transform.position, Vector3.back * gesture.deltaPosition.y , Time.deltaTime * .1f);
    37.         #endregion
    38.     }
    39.  
    40.     IEnumerator SmoothStop()
    41.     {
    42.         yield return new WaitForSeconds(.2f);
    43.         gestureOnSwipe = null;
    44.     }
    45.  
    46.     #region TryToLerp
    47.     void LateUpdate()
    48.     {
    49.         if (gestureOnSwipe != null)
    50.         {
    51.             transform.position = Vector3.Lerp(transform.position, Vector3.left * gestureOnSwipe.deltaPosition.x , Time.deltaTime * .1f);
    52.             transform.position = Vector3.Lerp(transform.position, Vector3.left * gestureOnSwipe.deltaPosition.y , Time.deltaTime * .1f);
    53.         }
    54.     }
    55.     #endregion
    56. }
    Using this could be help
    Mathf.Lerp or Vector3.SmoothDamp
    But i don't know how to decide Camera destination (using gesture.deltaPosition) that are changing dynamically when we swipe it.
    I am using Unity 4.6.7 and EasyTouch 4
     
  14. Hedgehog-Team

    Hedgehog-Team

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

    I made this example precisely for not having smooth. I wanted a camera based on Slide.

    For your need, you must calculate the equivalence translate, to use it in your lepr with something like this :

    // You must add the current position to compute the destination relative the delta
    float x = transform.position.x + Vector3.left * gesture.deltaPosition.x
    float z = transform.position.z + Vector.back * gesture.deltaPosition.y

    transform.position = Vector3.Lerp( transform.position, new Vector3(x,transform.position.y,z), time.deltaTime *0.1f);
     
  15. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,191
    I am trying out Easy Touch with Unity UNET and have problems. I understand the problem but i do not know how to solve it. I do have NetworkIdentity on the prefab i click on.

    If i remove "if (isLocalPlayer) {" the error is not there. Also, i have just tested in the editor server/client.

    I have added NetworkIdentity to EasyTouch module. The error i get is

    Code (CSharp):
    1. There is no NetworkIdentity on this object. Please add one.
    2. UnityEngine.Networking.NetworkBehaviour:get_isLocalPlayer()
    3. MyScript_1:On_TouchStart(Gesture) (at Assets/MyScript_1.cs:38)
    4. EasyTouch:RaiseEvent(EventName, Gesture) (at Assets/EasyTouchBundle/EasyTouch/Plugins/EasyTouch.cs:1353)
    5. EasyTouch:CreateGesture(Int32, EventName, Finger, SwipeDirection, Single, Vector2) (at Assets/EasyTouchBundle/EasyTouch/Plugins/EasyTouch.cs:818)
    6. EasyTouch:OneFinger(Int32) (at Assets/EasyTouchBundle/EasyTouch/Plugins/EasyTouch.cs:610)
    7. EasyTouch:Update() (at Assets/EasyTouchBundle/EasyTouch/Plugins/EasyTouch.cs:507)
    The code i have is:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UnityEngine.Networking;
    4. using UnityEngine.UI;
    5.  
    6. public class MyScript_1 : NetworkBehaviour {
    7.  
    8.     public Text myText1;
    9.     public Text myText2;
    10.  
    11.  
    12.     // Subscribe to events
    13.     void OnEnable(){
    14.         EasyTouch.On_TouchStart += On_TouchStart;
    15.     }
    16.     // Unsubscribe
    17.     void OnDisable(){
    18.         EasyTouch.On_TouchStart -= On_TouchStart;
    19.     }
    20.     // Unsubscribe
    21.     void OnDestroy(){
    22.         EasyTouch.On_TouchStart -= On_TouchStart;
    23.     }
    24.  
    25.     void Start () {
    26.         myText1.text = "text åt vänster";
    27.         myText2.text = "text åt höger";
    28.  
    29.     }
    30.  
    31.  
    32.     // Touch start event
    33.     public void On_TouchStart(Gesture gesture){
    34.         //Debug.Log( "Touch in " + gesture.position);
    35.  
    36.         if (gesture.pickedObject != null) {
    37.  
    38.             if (isLocalPlayer) {
    39.                 myText1.text = "Tag: " + gesture.pickedObject.tag;
    40.             }
    41.  
    42.         }
    43.  
    44.     }
    45. }
     
    Last edited: Nov 27, 2015
  16. Hedgehog-Team

    Hedgehog-Team

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

    I don't know UNET I never used it, but I just read a little doc, and know how client/server are working :)

    So the error doesn't come from EasyTouch but how you use UNET. Indeed EasyTouch only sends a message to an object , which is a NetworkBehaviour object, that all . EasyTouch is client side component, you have nothing to do event for client/serveur.

    The error indicates that there is no network identity, Where did you put the Network Identity component ? (http://docs.unity3d.com/Manual/class-NetworkIdentity.html && http://docs.unity3d.com/ScriptReference/Networking.NetworkIdentity.html)

    Extract from documentaiton
    Hints
    • Put a NetworkIdentity component on prefabs that will be spawned.
    • A NetworkIdentity is required for every object that is networked.
     
    Last edited: Nov 27, 2015
  17. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,191
    I have a NetworkIdentity on the prefab i use as stated in my text. I also tried with and without a network identity on the Easy Touch module.
     
  18. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,191
    Problem solved, i have an empty GameObject with the script were i did not put NetworkIdentity! hmmm i am such a Noob!
     
  19. Goofy420

    Goofy420

    Joined:
    Apr 27, 2013
    Posts:
    248
    The ETCArea component could really use a MiddleLeft and MiddleRight preset. As it is now, it can only be set to the top or bottom of the screen. So changing the position at runtime is improbable unless it is set to the top or bottom of the screen.
     
  20. Hedgehog-Team

    Hedgehog-Team

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

    I do not understand very well what you mean.ETCArea component allows to define a specific area for a dynamic joystick. Presets let just a quick setup int editor, but it is up to you size it and position it as desired, as you would with any UI component with his RectTansform component.
     
  21. HWQLearner

    HWQLearner

    Joined:
    Jan 24, 2014
    Posts:
    7
    Hi, I am new in easy touch. May I know is it possible that I drag an cube on x,y and z axis?
     
  22. Hedgehog-Team

    Hedgehog-Team

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

    When you do a gesture on a touchscreen you're in 2D screen position , but to move an object in a 3D world you need 3 coordinate. In examples provided you can drag object in X,Y and the Z is actual Z position of objects. BTW functions provided by Unity for converting a 2D screen position to 3D world require 3rd position information of distance from the camera, because for a 2D screen position, there is a multitude of 3D position in the world.

    So in your case (move in all axes), you will need further action . For example simple drag move your object in X,Z ann keep his Y position, and a two finger drag move your object in Y and keeping his X & Z position.

    For information, Easy Touch 5 is underway in this new version there is no change in the engine that works in very well, but new components will allow you to do simple action as drag, rotation translation of the object without having to write code. If interested, contact the email (the.hedgehog.team@gmail.com) support with your invoice number, I can Provided a beta version of the new components
     
  23. Hedgehog-Team

    Hedgehog-Team

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

    EasyTouch 5 is in progress.

    New Features
    • New components for beginners, that make simple actions without a code (Rotation, Translate, Drag, Enter/OverExit detection)
    Example

    • New method to use gestures (in addition to C # event) in Update callback

    Example
    Code (CSharp):
    1. public class NewEasyTouchPossibilities : MonoBehaviour {
    2.  
    3.     // Update is called once per frame
    4.     void Update () {
    5.  
    6.         Gesture gesture = EasyTouch.current;
    7.  
    8.         if( gesture.type == EasyTouch.Type.On_TouchStart && gesture.fingerIndex==1){
    9.             Debug.Log( "So cool !");
    10.         }
    11.     }
    12. }
     
  24. maidamedia

    maidamedia

    Joined:
    Nov 19, 2009
    Posts:
    224
    It seems that doesn't work. I attached the script to the player (that has the camera as a child) and in the OnMove event I choose the player as object and applied the My_Joystickmove. When I press the joystick to rotate the view it seems that the camera rotates immediately by 180°. It is not a progressive rotation but an immediate inversion of the view. How can I solve this? Thanks
     
  25. Hedgehog-Team

    Hedgehog-Team

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

    First
    May be there is a misunderstanding on my part compared to what you described. This script directs the player depending on the direction of the joystick and moves the same time (like Angry demo bot). This is the simple solution without smoothness.

    To be sure we're talking about the same thing , look at this little video where I use this script on a simple capsule object. If this is not what you expected, do not let the following email, but could you provide me a link to a video, or explain in more detail what you expect.

    Example video : Look at capsule axis relative to joystick orientation


    Second : That's what you want but you don't have the same result

    if you use a character that doesn't has an right orientation of its axis compared to the orientation of Unity world, you'll get sharp jumps in the rotation and that do not match the orientaiton joystick. As you can see in the video the capsule Z axis is aligned with Unity Z axis. You must have the same thing, with your character.

    That is why, Unity advocates to attach any object whose orientation is not correct to attach it to a gameobject and then orient it correctly in relation to the parent. (http://docs.unity3d.com/Manual/HOWTO-FixZAxisIsUp.html). Otherwise, all the scripts that applies a calculated rotation will give a bad result from the model, but adequate in relation to the axis of the world Unity


    Third : I want smooth rotation
    Indeed if you ask a direction that is opposite to the current direction of the player, there will be no progressivity in the rotation. The player will face instantly in the new direction.

    So add a lerp on the action of the rotation, But in this case, it will take the players do face his new direction before you can move it forward. This can be done with the vector dot product. But in 95% of games that uses this mode , this rotation "smoothness" is not used, because as you understand this seriously affected the gameplay. And if smooth is too fast, it returns to the starting before adding smooth. It would also have the opportunity to apply that 'smothnees" only when the angle difference between the current and destination orientation is graterto X °

    But before going further, I'll wait for the answer to the question in the first item.
     
  26. maidamedia

    maidamedia

    Joined:
    Nov 19, 2009
    Posts:
    224
    It was the second scenario, now it works much better. Thank you Nicolas!
     
  27. Hedgehog-Team

    Hedgehog-Team

    Joined:
    Feb 27, 2011
    Posts:
    1,155
  28. maidamedia

    maidamedia

    Joined:
    Nov 19, 2009
    Posts:
    224
    My player and my camera are instantiated at start, so I can't set "Direct action to" in the inspector. I want to do that with the GameObject.FindGameObjectsWithTag("Player"), but where should I do this?
     
  29. Hedgehog-Team

    Hedgehog-Team

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

    Currently you have to think the other way, ie that it is your "player" to notify the virtual control, by using the class ETCInput

    To do this :
    1 - Create a new script that register the gameobject for the axes of your control
    void Start(){
    ETCInput.SetAxisDirecTransform( "your X axis name", gameobject.transform);
    ETCInput.SetAxisDirecTransform( "your Y axis name", gameobject.transform);
    }

    2- Attach this script to your gameobject with "Player"

    Functionality to connect a control directly on the gameobject with tag "player" will be available in the next verison
     
  30. maidamedia

    maidamedia

    Joined:
    Nov 19, 2009
    Posts:
    224
    Thx! I have the same problem with the OnMove event (you probably remember that I have asked for a single controller with move and rotate). How can I solve this? Also, after using your script to rotate and move with the same joystick, my character doesn't walk but just moves without animation.
     
  31. Hedgehog-Team

    Hedgehog-Team

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

    So actually if you now assign the player dynamically, your script which received messages from the controls is no more bound to the joystick, so no more message reception, and no more animaton

    You have to register on the events of the joystick. EasyTouch controls use the new event system from Unity.

    Here how to register
    Code (CSharp):
    1. public class DynamicSub : MonoBehaviour {
    2.  
    3.     public ETCJoystick myJoystick;
    4.  
    5.     void Start () {
    6.         myJoystick.onMove.AddListener( MoveCallBack );
    7.     }
    8.  
    9.  
    10.     void MoveCallBack(Vector2 move){
    11.               // here your code to launch animation relative to the joystick axes value into the variable move
    12.     }
    13. }
     
  32. maidamedia

    maidamedia

    Joined:
    Nov 19, 2009
    Posts:
    224
    which object should have this new script?
     
  33. Hedgehog-Team

    Hedgehog-Team

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

    The object that you want to animate relative to the joystick, in your case you player. It's an exemple to "how to register to an event"
     
  34. mthicke2

    mthicke2

    Joined:
    Aug 23, 2012
    Posts:
    15
    how do I register the button in a similar fashion as your code in the previous post - something like:

    Code (CSharp):
    1.  
    2. public ETCButton myButton;
    3.  
    4. void Start () {
    5.    myJoystick.onButtonDown.AddListener( ButtonDownCallBack );
    6. }
    7.  
    8. void ButtonDownCallBack(??){
    9. }
    10. void ButtonUpCallBack(??){
    11. }
    12.  
     
  35. Hedgehog-Team

    Hedgehog-Team

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

    Yes, Callback method must have same parameter as button event in the inspector. So nothing in case of Down / Pressed/ Up event.

    But if you want to receive Up & donw event, you must register to OnButtonDown & OnButtonUp, and use the correct variable name ...

    I know the Unity documentation doesn't give a lot of detail (http://docs.unity3d.com/ScriptReference/Events.UnityEvent.AddListener.html)

    upload_2015-12-19_22-10-54.png
     
  36. Hedgehog-Team

    Hedgehog-Team

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

    Some news about EasyTouch 5, it will provide native support for PlayMaker. It may therefore be used by no coder people.

    toto.png
     
    Tinjaw likes this.
  37. jococo

    jococo

    Joined:
    Dec 15, 2012
    Posts:
    232
    Hello,

    I'm trying to get the value of the axis of a joystick I have setup.


    Before I tried c# and this worked fine:

    Code (CSharp):
    1. float axisVertValue =ETCInput.GetAxis("Vertical");

    I try the same in javascript and it doesn't know what ETCInput is. I moved all plugins into Assets/Plugins and still no luck.

    "Unknown identifier: 'ETCInput'."

    How do I access the joystick axis values in javascript?
     
  38. Hedgehog-Team

    Hedgehog-Team

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

    Weird, It's working for me. You project view must be like that

    upload_2016-1-3_1-32-2.png

    And here a little javascript that write the value of vertical axis
    Code (CSharp):
    1. #pragma strict
    2.  
    3. function Start () {
    4.  
    5. }
    6.  
    7. function Update () {
    8.  
    9.     var x:float = ETCInput.GetAxis("Vertical");
    10.     Debug.Log( x);
    11. }
     
  39. jococo

    jococo

    Joined:
    Dec 15, 2012
    Posts:
    232
    Yes I forgot to move those files. All good now! Thank you for the help.
     
  40. Hedgehog-Team

    Hedgehog-Team

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

    Ok, in EasyTouch 5 there will be an option that will allow you to do just this action
    upload_2016-1-4_11-4-46.png
     
  41. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    Hi there,

    I'd like to ask some questions about Easy Touch.

    I am looking for touch joystick AND gesture / swipe support solution for iOS/Android.

    1. Asset store images/text are bit perplexing - do I need both Easy Touch Controls AND Easy Touch 4, if I need both swipes/gestures AND joysticks+buttons? Somehow text doesn't say it clearly.

    2. Is there a list of supported platforms?

    3. What is the file size of asset in Unity project? Ballpark figure.

    4. Is it possible to see full list of features somewhere? I wouldn't like to guess, I could only find forum links.

    5. Is it possible to easily extend / add more gestures if some are missing?

    6. Is there a API documentation available on web?

    7. Is there a manual available?
     
  42. Hedgehog-Team

    Hedgehog-Team

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

    1- Easy Touch 4 is a bundle with 2 part:
    - A gesture manager (tap, pinch, swipe, twist etc...)
    - A Set of virtual controller

    This is not the same thing, which can be used independently. You can use Virtual controller without use gesture manager, and conversely. Or use the both at the same time (They are complementary)

    2- EasyTouch support all platforms supported by Unity with touch support (IOS, Android, Window Phone, black Berry) TV_OS is coming in febrary with EasyTouch 5

    3- There is no real size is a set script & class that work together.

    4- EasyTouch is a gesture manager, it's an API. It is therefore difficult to establish a list because you can create your own tool from EasyTouch, and Virtual controls have a lot of feature. You can watch some video here

    In summary :
    - Gesture recognition (Tap, Double Tap, Touch, Twist, Pinch, Swipe, Drag) with different state (start, progress, end)
    - Multi-touch support
    - Auto -selection (2D/3D)
    - Support of UGUI
    - Multi layer
    - Multi camera
    - 2 second finger simulation

    For virtual controls
    - WYSIWYG editing
    - 100% UGUI
    - Quick action without a line of code
    - Input manager for quick migration
    - Event


    5- It is not possible to define your own gestures directly but EasyTouch is relatively flexible and has many possibilities.
    Can you give me an example of what gesture you think?

    6/7- You can find online documentation here
     
    eses likes this.
  43. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    Hedgehog Team:

    thank you for good info. I'm browsing the manual just now! I think it'll have answers to my questions!

    "Can you give me an example of what gesture you think?" - I was playing with multiple touches with finger IDs, was thinking about making support for detecting two finger + another gesture at the same time - is this possible?
    I could think this kind of setup: Detect some two finger gesture, and at the same time detect one finger gesture. I.e. detect two finger gesture by some maximum distance between touches and separate third touch as something else. Maybe it's possible already? Four fingers might not be good idea at all on iOS.
     
    Last edited: Jan 13, 2016
  44. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    Hedgehog Team:

    More questions:

    Another question related to buttons/d-pad style controls - is it possible to start touch outside of d-pad like setup, now in all webplayer demos in Asset Store, click/taps must start from inside rectangle defining d-pad... otherwise you cant start sliding over buttons? Can this be changed by user?

    EDIT: (right edge demo scene has this for button but does it work for d-pad?) Does swipe out work? Seems like "swipe in" toggle does both, but swipe out from button doesn't work - or does swipe out mean you can swipe out and still keep pressing button... seems so.

    Touch pad question - There seems to be touchpad in one example, but it gives errors in Asset Store demo? (Seems like level wasn't added to build settings. Anyway, would have liked to test generic swipe touch pad.

    Pinch / twist simulation - Correct me if I'm wrong, but this seems to be broken too in demo. Pressing Alt, activates second tap, but it seems to be everywhere, it doesn't emit from last tap location, neither does it locate itself to cursor location of alt+click start location. I'd expect it to work so that when alt is pressed, tap 2 appears on cursor location, then you move mouse, and press down when actual mouse and mirrored tap positions are aligned properly, and then do your drag. Now if I alt+click on different locations, I get totally wonky tap offsets, which makes it impossible to do proper simulated twists and pinches.
     
    Last edited: Jan 13, 2016
  45. Hedgehog-Team

    Hedgehog-Team

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

    EasyTouch always always sends the events for all keys, even for a 2-finger gesture. Ie, if you receive a Pinch, you will also receive events for single finger for each touches. In a way you could do what you want in the Manager yourself.

    DPAD
    Slide in / out option is only available for button and touchPad. But it's a good idea to add this features on the DPAD.

    Swipe from button, mean that you can move out the button and still keep pressing button. This is what allows in the FPS demo, to aim to and shoot in the same time.

    Touch pad question
    Thank you, you're first guy to feedback this error. The bug is fixed you can launch again the player.

    EasyTouch Controls is thought to be generic, between each control and orineter for the games.
    The touchpad does not have as much possibility that you can have with EasyTouch and gesture management

    Pinch / twist simulation
    The second finger simulation work fine for me in the web player. But you have 2 key Alt & Ctrl.

    Alt = Allow you enable / simulate Twist & Pinch
    - The fulcrum is the center position between the cursor and the orange circle
    - Mouse down simulate the touches

    Crtl = Allow you enable s/ simulate swipe & drad

    - Move the fulcrum
    - Mouse down simulate the touches
     
  46. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    Hedgehog Team:

    Thank you for reply again!

    Pinch / twist simulation: It does not work for me; tried in both latest Firefox beta and age old opera. I have to tap Ctrl between alt+clicks, otherwise two finger gesture center will be on previous location? I.e. do first two finger twist in center of screen, then go to other location, alt+click, and other finger dot is relative to center of screen...? Unless I press Ctrl in between, and see orange dot reset to mouse cursor.
     
    Last edited: Jan 14, 2016
  47. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    Hedgehog Team:

    Another question related to d-pad - can I create a d-pad out of buttons? As it supports all I need, can I make buttons click detection area rectangular, instead of square? That way I could build d-pad from buttons.
     
  48. Hedgehog-Team

    Hedgehog-Team

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

    Pinch/Twist simulation

    The fulcrum is alway the center between orange cercle and mouse position.

    Holding down alt key pressed, the position of the simulation is the mirror of the mouse relative to the central position upon activation.

    Holding down ctrl key, theposition of the simulation the position of the simulation is parallel and in the same direction as the mouse cursor.

    I am really curious to see the bug, do you have skype account?

    DPaD
    The control d-PAD uses a single simple image, you can redefine its size, or use a non-square image.

    Otherwise you can also create your own DDPA with a set of four buttons, which can also be non-square
     
  49. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    513
    Great news, can you please elaborate on how that'll work? Directional swipes?
     
  50. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637