Search Unity

Touch Controls Kit v1.5 - Powerful, Flexible and Intuitive to use touch kit [RELEASED]

Discussion in 'Assets and Asset Store' started by Victor-K, Nov 11, 2013.

  1. Victor-K

    Victor-K

    Joined:
    Nov 10, 2013
    Posts:
    208
    Hello,
    Unfortunately, this functionality not yet, expect updates soon.
     
  2. Demonith88

    Demonith88

    Joined:
    Jun 30, 2014
    Posts:
    213
    @Victor Klepikov awesome done with asset i love it but i get it because i making third person game so can u make a a fast tutorial on how to control camera and character with your kit
     
  3. alarm656

    alarm656

    Joined:
    Jul 6, 2013
    Posts:
    107
    No more Unity 4? Only Unity 5?
     
  4. IndieFist

    IndieFist

    Joined:
    Jul 18, 2013
    Posts:
    349
    I get it working with raycast, if you want to watch my code i can send you a file.
    Thank you.
     
  5. Victor-K

    Victor-K

    Joined:
    Nov 10, 2013
    Posts:
    208
    yes, Only Unity 5, Unity 4 maybe in future.
     
  6. Victor-K

    Victor-K

    Joined:
    Nov 10, 2013
    Posts:
    208
    See a FirstPerson example scene.
    TCK Input API as UnityEngine.Input
     
  7. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    996
    Hi Victor,

    Just started using the kit. Very nice! Copied the canvas and dpad setup + eventsystem from a demo scene and then added 3 lines of code (also copied from the demo) to my player script and was up and running.

    One question though as I can't see any reference to it.

    I have been testing my game with keyboard and xbox controller for pc and it worked fine.

    After adding the TCK to the project the keyboard and TCK work well together but the xbox controller doesn't work at all now.

    Any ideas?

    Thanks again.

    doc
     
  8. Victor-K

    Victor-K

    Joined:
    Nov 10, 2013
    Posts:
    208
    Hello,
    It's strange, TCK don't have custom input project settings.
    Check the input settings in your project.
     
  9. Demonith88

    Demonith88

    Joined:
    Jun 30, 2014
    Posts:
    213
    Well i working on MMO so the player is created and then spawned in scene can u help me out make this work and how i am not coder as well the thing that i need is a 3 p controller like Order and chaos similar
     
  10. coder_for_life22

    coder_for_life22

    Joined:
    Dec 25, 2013
    Posts:
    46
    Hello,

    I am using the steering wheel.

    When my game is in portrait mode the wheel shows up in its correct position. But when I change orientations to landscape mode, the wheel disappears off the screen.

    Does anyone know how I can get the wheel to reposition itself when the orientation changes?
     
  11. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    996

    Thanks for getting back to me Victor. I have updated everything and will let you know if I get the same problem.

    Thanks
     
  12. coki27

    coki27

    Joined:
    Jun 17, 2015
    Posts:
    6
    Hi, first of all great asset very fast and easy implementation with API. Can you please tell me where the "use mouse" checkbox is I can't seem to find it so I can uncheck it ? Спасибо brat
     
  13. emakbaba

    emakbaba

    Joined:
    Aug 16, 2014
    Posts:
    4
    Hello,

    I bought your fps asset and mobile controller asset but i dont integrated. Any tutorial or documentation?

    Thanks.
     
  14. Victor-K

    Victor-K

    Joined:
    Nov 10, 2013
    Posts:
    208
    Hello, please see it.
     
  15. Victor-K

    Victor-K

    Joined:
    Nov 10, 2013
    Posts:
    208
    it`s automatically Unity UI native functional.
     
  16. buFFalo94

    buFFalo94

    Joined:
    Sep 14, 2015
    Posts:
    204
    Hi victor how does your asset work with a custom camera in perspective view and a canvas using screen space overlay
     
  17. CLCEntertainment

    CLCEntertainment

    Joined:
    Aug 14, 2015
    Posts:
    3
    Hey Victor, I've been in search of this "use mouse" option you say to turn off to enable multi touch but i have yet to locate it, can you please tell me how to go about fixing this so multi touch works? Ty!
     
  18. macleve

    macleve

    Joined:
    Apr 19, 2016
    Posts:
    11
    sorry for bothering u bro i just bought the TCK asset from the assetstore and now trying to using it on my project but ...there's 7 errors in the game

    ERRORS:
    1)NullReferenceException: Object reference not set to an instance of an object
    TouchControlsKit.TCKInput.GetButtonDown (System.String buttonName) (at Assets/TouchControlsKit/Scripts/TCKInput.cs:703)
    SkillWindow.Update () (at Assets/PlatformerKit/Script/SkillWindow.cs:45)

    2)NullReferenceException: Object reference not set to an instance of an object
    TouchControlsKit.TCKInput.GetButtonDown (System.String buttonName) (at Assets/TouchControlsKit/Scripts/TCKInput.cs:703)
    Inventory.Update () (at Assets/PlatformerKit/Script/Inventory.cs:63)

    3)NullReferenceException: Object reference not set to an instance of an object
    TouchControlsKit.TCKInput.GetAxis (System.String controllerName, AxisType axisType) (at Assets/TouchControlsKit/Scripts/TCKInput.cs:379)
    PlayerInputController.Update () (at Assets/PlatformerKit/Script/PlayerInputController.cs:132)

    4)NullReferenceException: Object reference not set to an instance of an object
    TouchControlsKit.TCKInput.GetButtonDown (System.String buttonName) (at Assets/TouchControlsKit/Scripts/TCKInput.cs:703)
    StatusWindow.Update () (at Assets/PlatformerKit/Script/StatusWindow.cs:28)

    5)NullReferenceException: Object reference not set to an instance of an object
    TouchControlsKit.TCKInput.GetButton (System.String buttonName) (at Assets/TouchControlsKit/Scripts/TCKInput.cs:721)
    AttackTrigger.Update () (at Assets/PlatformerKit/Script/AttackTrigger.cs:219)

    6)NullReferenceException: Object reference not set to an instance of an object
    TouchControlsKit.TCKInput.GetButtonDown (System.String buttonName) (at Assets/TouchControlsKit/Scripts/TCKInput.cs:703)
    SaveGame.Update () (at Assets/PlatformerKit/Script/SaveLoad/SaveGame.cs:20)

    7)NullReferenceException: Object reference not set to an instance of an object
    TouchControlsKit.TCKInput.GetButtonDown (System.String buttonName) (at Assets/TouchControlsKit/Scripts/TCKInput.cs:703)
    ActivateController.Update () (at Assets/PlatformerKit/Script/ActivateController.cs:21)


    here is my playerinputcontroller script:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using TouchControlsKit;
    4.  
    5. [RequireComponent (typeof (CharacterMotor))]
    6.  
    7. public class PlayerInputController : MonoBehaviour {
    8.    
    9.     private CharacterMotor motor;
    10.     private PlayerAnimation anim;
    11.     public float walkSpeed = 6.0f;
    12.     public float dashSpeed = 12.0f;
    13.     public float dashDuration = 0.5f;
    14.     private GameObject mainModel;
    15.     public bool groundDash = true;
    16.     public bool airDash = false;
    17.     public bool doubleJump = false;
    18.     public bool wallKick = false;
    19.     public GameObject dashEffect;
    20.     public GameObject wallKickEffect;
    21.     public GameObject wallSlideEffect;
    22.    
    23.     [HideInInspector]
    24.     public bool dashing = false;
    25.     private bool jumpingDash = false;
    26.     private bool jumpingDown = false;
    27.     [HideInInspector]
    28.     public bool onWallSlide = false;
    29.     private bool airJump = false;
    30.     [HideInInspector]
    31.     public bool airMove = false;
    32.     [HideInInspector]
    33.     public bool onWallKick = false;
    34.     [HideInInspector]
    35.     public float originalX = 0.0f;
    36.     private float gravity = 20.0f;
    37.     //public Rigidbody rb;
    38.  
    39.     //----------Sounds-------------
    40.     [System.Serializable]
    41.     public class MovementSound {
    42.         public AudioClip jumpVoice;
    43.         public AudioClip walkingSound;
    44.         public AudioClip dashVoice;
    45.     }
    46.     public MovementSound sound;
    47.  
    48.  
    49.     // Use this for initialization
    50.     void  Start (){
    51.         motor = GetComponent<CharacterMotor>();
    52.         anim = GetComponent<PlayerAnimation>();
    53.         mainModel = GetComponent<Status>().mainModel;
    54.         gravity = motor.movement.gravity;
    55.         originalX = transform.position.x;
    56.         if(wallSlideEffect){
    57.             wallSlideEffect.SetActive(false);
    58.         }
    59.         if(dashEffect){
    60.             dashEffect.SetActive(false);
    61.         }
    62.  
    63.         //rb = GetComponent<Rigidbody> ();
    64.     }
    65.    
    66.     // Update is called once per frame
    67.     public void  Update (){
    68.         Status stat = GetComponent<Status>();
    69.         if(transform.position.x != originalX){
    70.             transform.position = new Vector3(originalX , transform.position.y , transform.position.z);
    71.         }
    72.         if(stat.freeze || stat.flinch){
    73.             motor.inputMoveDirection = new Vector3(0,0,0);
    74.             return;
    75.         }
    76.         if(Time.timeScale == 0.0f){
    77.             return;
    78.         }
    79.         CharacterController controller = GetComponent<CharacterController>();
    80.        
    81.         if(jumpingDash){
    82.             //Jump while dashing
    83.             if(TCKInput.GetButtonUp("jumpBtn")){
    84.                 CancelDashJump();
    85.             }
    86.             //Vector3 jd = transform.TransformDirection(new Vector3(0 , 2 , Mathf.Abs(Input.GetAxis("Horizontal")) +1));
    87.             //controller.Move(jd * 5 * Time.deltaTime);
    88.             Vector3 jd = transform.TransformDirection(new Vector3(0 , 2 , Mathf.Abs(TCKInput.GetAxis( "dPad", AxisType.X )) +1));
    89.             controller.Move(jd * 5 * Time.deltaTime);
    90.             return;
    91.         }
    92.         if(jumpingDown){
    93.             //Vector3 jdown = transform.TransformDirection(new Vector3(0 , 0 , Mathf.Abs(Input.GetAxis("Horizontal")) +1));
    94.             //controller.Move(jdown * 4 * Time.deltaTime);
    95.             Vector3 jdown = transform.TransformDirection(new Vector3(0 , 0 , Mathf.Abs(TCKInput.GetAxis( "dPad", AxisType.X )) +1));
    96.             controller.Move(jdown * 4 * Time.deltaTime);
    97.             return;
    98.         }
    99.         if(onWallKick){
    100.             //Wall Kick
    101.             Vector3 wk = transform.TransformDirection(new Vector3(0 , 2.5f , -1));
    102.             controller.Move(wk * 6 * Time.deltaTime);
    103.             return;
    104.         }
    105.        
    106.         if(airJump){
    107.             //Double Jump
    108.             //Vector3 aj = transform.TransformDirection(new Vector3(0 , 2.5f , Mathf.Abs(Input.GetAxis("Horizontal"))));
    109.             //controller.Move(aj * 4 * Time.deltaTime);
    110.             Vector3 aj = transform.TransformDirection(new Vector3(0 , 2.5f , Mathf.Abs(TCKInput.GetAxis( "dPad", AxisType.X ))));
    111.             controller.Move(aj * 4 * Time.deltaTime);
    112.             return;
    113.         }
    114.        
    115.         if (dashing){
    116.             //Dash
    117.             if(TCKInput.GetButtonUp("dash") || Input.GetKeyUp(KeyCode.LeftShift) || !motor.canControl){
    118.                 CancelDash();
    119.             }
    120.             if(TCKInput.GetButtonDown("jumpBtn") && (controller.collisionFlags & CollisionFlags.Below) != 0){
    121.                 StartCoroutine("DashJump");
    122.             }
    123.             Vector3 fwd = transform.TransformDirection(Vector3.forward);
    124.             controller.Move(fwd * dashSpeed * Time.deltaTime);
    125.             //motor.inputMoveDirection = fwd;
    126.             return;
    127.         }
    128.        
    129.         // Get the input vector from kayboard or analog stick
    130.         //Vector3 directionVector = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
    131.         //Vector3 directionVector = new Vector3(0 , 0, Input.GetAxis("Horizontal"));
    132.         Vector3 directionVector = new Vector3(0 , 0, TCKInput.GetAxis( "dPad", AxisType.X ));
    133.         //Vector3 directionVector = new Vector3(Input.GetAxis("Horizontal") , 0, 0);
    134.        
    135.         if (directionVector != Vector3.zero) {
    136.             // Get the length of the directon vector and then normalize it
    137.             // Dividing by the length is cheaper than normalizing when we already have the length anyway
    138.             float directionLength = directionVector.magnitude;
    139.             directionVector = directionVector / directionLength;
    140.            
    141.             // Make sure the length is no bigger than 1
    142.             directionLength = Mathf.Min(1, directionLength);
    143.            
    144.             // Make the input vector more sensitive towards the extremes and less sensitive in the middle
    145.             // This makes it easier to control slow speeds when using analog sticks
    146.             directionLength = directionLength * directionLength;
    147.            
    148.             // Multiply the normalized direction vector by the modified length
    149.             directionVector = directionVector * directionLength;
    150.         }
    151.        
    152.         // Apply the direction to the CharacterMotor
    153.         //if(Input.GetAxis("Horizontal") > 0.1){
    154.         if(TCKInput.GetAxis( "dPad", AxisType.X ) > 0.1){
    155.             transform.eulerAngles = new Vector3 (transform.eulerAngles.x, 0, transform.eulerAngles.z);
    156.         }//else if(Input.GetAxis("Horizontal") < -0.1){
    157.         else if(TCKInput.GetAxis( "dPad", AxisType.X ) < -0.1){
    158.             transform.eulerAngles = new Vector3 (transform.eulerAngles.x, 180, transform.eulerAngles.z);
    159.         }
    160.         //motor.inputMoveDirection = transform.rotation * Vector3.forward;
    161.         //motor.inputMoveDirection = new Vector3(0 , 0, Input.GetAxis("Horizontal"));
    162.         motor.inputMoveDirection = new Vector3(0 , 0, TCKInput.GetAxis( "dPad", AxisType.X ));
    163.         //Double Jump Down
    164.         //if(TCKInput.GetButtonDown("jumpBtn") && !motor.grounded && doubleJump){
    165.         if(TCKInput.GetButtonDown("jumpBtn") && !motor.grounded ){
    166.             StartCoroutine("DoubleJumping");
    167.         }
    168.        
    169.         if (controller.collisionFlags == CollisionFlags.None && onWallSlide){
    170.             CancelWallSlide();
    171.         }
    172.  
    173.         if(TCKInput.GetButtonDown("jumpBtn") && sound.jumpVoice && motor.grounded){
    174.             GetComponent<AudioSource>().clip = sound.jumpVoice;
    175.             GetComponent<AudioSource>().Play();
    176.         }
    177.         //if(Input.GetAxis("Horizontal") != 0 && sound.walkingSound && !GetComponent<AudioSource>().isPlaying){
    178.         if(TCKInput.GetAxis( "dPad", AxisType.X ) != 0 && sound.walkingSound && !GetComponent<AudioSource>().isPlaying){
    179.             GetComponent<AudioSource>().clip = sound.walkingSound;
    180.             GetComponent<AudioSource>().Play();
    181.         }
    182.  
    183.         //Activate Sprint
    184.         if(TCKInput.GetButtonUp("dash") && !dashing && groundDash || Input.GetKeyDown(KeyCode.LeftShift)  && !dashing && groundDash){
    185.             //Dash
    186.             if((controller.collisionFlags & CollisionFlags.Below) != 0){
    187.                 //StartCoroutine(Dash());
    188.                 if(sound.dashVoice){
    189.                     GetComponent<AudioSource>().clip = sound.dashVoice;
    190.                     GetComponent<AudioSource>().Play();
    191.                 }
    192.                 StartCoroutine("Dash");
    193.             }else if(airDash && !onWallSlide){
    194.                 if(sound.dashVoice){
    195.                     GetComponent<AudioSource>().clip = sound.dashVoice;
    196.                     GetComponent<AudioSource>().Play();
    197.                 }
    198.                 StartCoroutine("AirDash");
    199.             }
    200.         }
    201.  
    202.         //motor.inputJump = Input.GetButton("Jump");
    203.         motor.inputJump = TCKInput.GetButton("jumpBtn");
    204.         //motor.inputJump = Input.GetKeyDown("c");
    205.     }
    206.    
    207.     IEnumerator Dash(){
    208.         if(!dashing){
    209.             if(dashEffect){
    210.                 dashEffect.SetActive(true);
    211.             }
    212.             dashing = true;
    213.             mainModel.GetComponent<Animation>().Play(anim.dash.name);
    214.             yield return new WaitForSeconds(dashDuration);
    215.             CancelDash();
    216.         }
    217.     }
    218.    
    219.     void CancelDash(){
    220.             StopCoroutine("Dash");
    221.             if(dashEffect){
    222.             dashEffect.SetActive(false);
    223.             }
    224.             mainModel.GetComponent<Animation>().Stop(anim.dash.name);
    225.             motor.freezeGravity = false;
    226.             dashing = false;
    227.     }
    228.    
    229.     IEnumerator AirDash(){
    230.         if(!dashing && !airMove){
    231.             if(dashEffect){
    232.                 dashEffect.SetActive(true);
    233.             }
    234.             airMove = true;
    235.             dashing = true;
    236.             motor.freezeGravity = true;
    237.             mainModel.GetComponent<Animation>().Play(anim.dash.name);
    238.             yield return new WaitForSeconds(dashDuration);
    239.             motor.freezeGravity = false;
    240.             CancelDash();
    241.         }
    242.     }
    243.    
    244.     public IEnumerator DoubleJumping(){
    245.         if(!airMove){
    246.             airMove = true;
    247.             airJump = true;
    248.             motor.freezeGravity = true;
    249.             yield return new WaitForSeconds(0.2f);
    250.             motor.freezeGravity = false;
    251.             airJump = false;
    252.         }
    253.     }
    254.    
    255.     public IEnumerator DashJump(){
    256.             CancelDash();
    257.             motor.freezeGravity = true;
    258.             jumpingDash = true;
    259.             yield return new WaitForSeconds(0.25f);
    260.             CancelDashJump();
    261.     }
    262.    
    263.     void CancelDashJump(){
    264.             if(jumpingDash){
    265.                 jumpingDown = true;
    266.             }
    267.             jumpingDash = false;
    268.             motor.freezeGravity = false;
    269.             StopCoroutine("DashJump");
    270.     }
    271.     //void OnCollisionStay(Collision col) {
    272.     void OnControllerColliderHit(ControllerColliderHit col) {
    273.         CharacterController controller = GetComponent<CharacterController>();
    274.         if(jumpingDown){
    275.             jumpingDown = false;
    276.         }
    277.             if(airMove && wallKick && col.gameObject.tag != "Enemy" && motor.grounded){
    278.             //if(airMove && wallKick && col.gameObject.tag != "Enemy"){
    279.                 airMove = false;
    280.                 motor.freezeGravity = false;
    281.             }else if(airMove && wallKick && col.gameObject.tag != "Enemy" && controller.collisionFlags == CollisionFlags.Sides && col.gameObject.tag == "Wall"){
    282.                     airMove = false;
    283.                     motor.freezeGravity = false;
    284.             }else if(airMove && (controller.collisionFlags & CollisionFlags.Below) != 0){
    285.                 airMove = false;
    286.                 motor.freezeGravity = false;
    287.             }
    288.            
    289.         if(col.gameObject.tag == "Wall"){
    290.             //(Input.GetButton("Horizontal") && !motor.grounded && controller.collisionFlags == CollisionFlags.Sides && Input.GetButton("Jump") && !motor.jumping.holdingJumpButton && wallKick){
    291.             if(TCKInput.GetAxis( "dPad", AxisType.X )>0||TCKInput.GetAxis( "dPad", AxisType.X )<0){
    292.                  //if(!motor.grounded && controller.collisionFlags == CollisionFlags.Sides && Input.GetButton("Jump") && !motor.jumping.holdingJumpButton && wallKick)
    293.                 if(!motor.grounded && controller.collisionFlags == CollisionFlags.Sides && TCKInput.GetButton("jumpBtn") && !motor.jumping.holdingJumpButton && wallKick)
    294.                     StartCoroutine(WallJump());
    295.             }//else if(Input.GetButton("Horizontal") && !motor.grounded && controller.collisionFlags == CollisionFlags.Sides && motor.movement.velocity.z == 0 && motor.movement.velocity.y <= 0 && wallKick){
    296.             else if(TCKInput.GetAxis( "dPad", AxisType.X )>0||TCKInput.GetAxis( "dPad", AxisType.X )<0){
    297.                     if(!motor.grounded && controller.collisionFlags == CollisionFlags.Sides && motor.movement.velocity.z == 0 && motor.movement.velocity.y <= 0 && wallKick)
    298.                 //Wall Slide
    299.                 CancelDashJump();
    300.                 onWallSlide = true;
    301.                 if(wallSlideEffect){
    302.                     wallSlideEffect.SetActive(true);
    303.                 }
    304.                 mainModel.GetComponent<Animation>().Play(anim.wallSlide.name);
    305.                 motor.movement.gravity = gravity / 4;
    306.                 motor.movement.maxFallSpeed = 5;
    307.             }else if(onWallSlide){
    308.                 CancelWallSlide();
    309.             }
    310.         }else if(onWallSlide){
    311.             CancelWallSlide();
    312.         }
    313.     }
    314.    
    315.     void CancelWallSlide(){
    316.                 if(wallSlideEffect){
    317.                     wallSlideEffect.SetActive(false);
    318.                 }
    319.                 onWallSlide = false;
    320.                 motor.movement.gravity = gravity;
    321.                 motor.movement.maxFallSpeed = 20;
    322.     }
    323.    
    324.     IEnumerator WallJump(){
    325.                 CancelWallSlide();
    326.                 CancelDashJump();
    327.                 mainModel.GetComponent<Animation>().Play(anim.wallKick.name);
    328.                 motor.freezeGravity = true;
    329.                 onWallKick = true;
    330.                 if(wallKickEffect){
    331.                     Instantiate(wallKickEffect , transform.position , wallKickEffect.transform.rotation);
    332.                 }
    333.                 if(wallSlideEffect){
    334.                     wallSlideEffect.SetActive(false);
    335.                 }
    336.                 yield return new WaitForSeconds(0.15f);
    337.                 motor.freezeGravity = false;
    338.                 onWallKick = false;
    339.     }
    340.    
    341.  
    342. }
    343.  
     
  19. Victor-K

    Victor-K

    Joined:
    Nov 10, 2013
    Posts:
    208
    Even included demo scenes after import into your project?
    PS: TCK Canvas must be pleaced on Scene.
     
  20. elpuerco63

    elpuerco63

    Joined:
    Jun 26, 2014
    Posts:
    271
    I have to joysticks that I toggle between during game play, left handed / right handed so at any one time only one is visible.

    I use this in the update function:

    float myHorizontal = TCKInput.GetAxis( "JoystickRotate", AxisType.X ) + Input.GetAxis( "Horizontal" );

    float myVertical = TCKInput.GetAxis( "JoystickRotate", AxisType.Y ) + Input.GetAxis( "Vertical" );

    But it only updates on whichever joystick is first visiblel when game starts even though both are named "JoystickRotate" and at any one time at least one joystick with this name is visble and active in game?

    Do you know what TCKInput does not see the control?
     
  21. Victor-K

    Victor-K

    Joined:
    Nov 10, 2013
    Posts:
    208
    AND copy from email:
    Hi,

    If active = false, then the controller is still visible, but does not react to touch.
    If visible = false, then the controller is not visible, but react to touch.
    --
    for hide controller on screen recommended to use 'enable = false'. TCKInput.SetControllerEnable.
     
    elpuerco63 likes this.
  22. elpuerco63

    elpuerco63

    Joined:
    Jun 26, 2014
    Posts:
    271
    Hi, I'm implementing dynamic button creation from a TCKButton prefab. I know in my Instantiate code how to set each new buttons normal and pressed sprites but not how to pass in the GameObject and function to add to button?

    So I see if I drop a new TCKButton in my scene and turn Events on I can assign a Click Event by setting a GameObject and then a function attached to that game object.

    I am passing in to my Instantiation script code like this:

    [System.Serializable]
    public class Action {

    public Sprite normalSprite;

    public Sprite pressedSprite;
    }

    public Action[] options;

    public void openMenu() {
    RadialMenuSpawner.instance.SpawnMenu (this);
    }

    I don't know how to include a GameObject and its function in Action class or if it is possible at runtime when the new TCKButton is instantiated I can say

    newButton.clickEvent = GameObject.clickFunction ??

    If that makes sense?

    Thanks
     
  23. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    336
    Hi,

    I want to have a touchpad, I want player to move camera when he drags his finger on the touchpad, but to make another action (shooting) when he only taps the touchpad.

    Can you help me on how to achieve that if it's possible with this asset. I can send you my invoice number with e-mail if you give me your e-mail address, I couldn't find one on the asset store page.
     
  24. Victor-K

    Victor-K

    Joined:
    Nov 10, 2013
    Posts:
    208
    Hello,

    The touchpad works like a mouse, and also can to broadcast touch events(see the manual, page 6).
    Also forums have a many community examples(as rts cam) are in free access
     
  25. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    969
    I am receiving an error "Controller: Touchpad not found" and the same for the Joystick. Your documentation about the components is good. But i'm missing something. Even when I drag everything from your FPS example into a new scene to recreate what you have as a starting point I get these errors. Please advise, thanks.

    controler.png
     
  26. Victor-K

    Victor-K

    Joined:
    Nov 10, 2013
    Posts:
    208
    Hello,
    Check the controller name in inspector panel and in code.
    This error shows when there is a call a non-existent controller name.
     
  27. topofsteel

    topofsteel

    Joined:
    Dec 2, 2011
    Posts:
    969
    Thank you for your reply. It turned out to be that I hadn't set up the events. Obvious after the fact, but I missed that. Nice asset!
     
  28. vivekchakraverty

    vivekchakraverty

    Joined:
    Mar 16, 2016
    Posts:
    5
    Can this be used with the third person controller by unity standard assets and what sort of modifications do I need to make, if yes?
     
  29. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,595
    @vivekchakraverty you'd need to make it so instead of checking for input from the keyboard and mouse, it checks for input from the asset, which I haven't used in a while but if I remember correctly has axis's (axes?) set up you can check, something along the lines of float horizontalInput = Input.GetAxis ("NameOfHorizontalJoystickAxis")

    Which you then use for aiming or moving.

    Good luck!
     
  30. hamel123

    hamel123

    Joined:
    Oct 1, 2016
    Posts:
    1
    I want to use your kit with my android what i'm doing i'm using joystick but how do i control and rotate the player..
     
  31. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,595
    @hamel123 I can't tell if that is a serious question or not - but if it is, sounds like you need to do some serious learning, perhaps in the "Learn" section of the unity site. Read the documentation for the asset to understand the basics of how it works, and also make sure you thoroughly understand the basics of unity and C#, because this sort of question is rather trivial, no offense!
     
  32. PedroSchabib

    PedroSchabib

    Joined:
    Oct 2, 2015
    Posts:
    5
    Is possible check if joystick is pressed, like GetAction ("JoyName",
    EActionEvent.Press/
    EActionEvent.Up/
    EActionEvent.Down)
     
  33. SirViver

    SirViver

    Joined:
    Jun 16, 2016
    Posts:
    1
    Hello! Just bought your TCK asset and it's great! My question is this: What is the proper way to easily take actions set up on a button and place them on another GameObject to make it a touchable button? Thanks for your help!
     
  34. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    336
    Hi Victor,

    I want to have a touchpad for aiming, and another button on top of it to fire. For now, when I hit button, it blocks the aim touchpad. How can I prevent this, to make functionality like Dead Trigger game. Is it possible?
     
  35. Victor-K

    Victor-K

    Joined:
    Nov 10, 2013
    Posts:
    208
    Hello,
    Unfortunately, this small detail there is to be Unity UI. Workaround until he finds.
    This is due to overlap with one another image and ray can't pass.
     
    valakot likes this.
  36. alarm656

    alarm656

    Joined:
    Jul 6, 2013
    Posts:
    107
    I'm having strange behavior if I child _TCKCanvas to player prefab
     
  37. DavidArts

    DavidArts

    Joined:
    Jan 19, 2017
    Posts:
    8
    Hello,
    I bought your touch control kit today and as I'm very new to unity (I player with some tutorials for 2 months) I need some help. I'm doing a platformer 2d game... and the player simply has to jump, run left or run right...
    I have a class playerInput that deal with the keyboard input.
    How can I change this code to make it work for iOS touch?

    #if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBPLAYER

    Vector2 directionalInput = new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"));
    player.SetDirectionalInput(directionalInput);
    ... some other code

    #endif
    #if UNITY_IPHONE || UNITY_IOS

    What should I put here in order to set my directional input using LEFT and RIGHT ARROWS?

    Thanks in advance,

    David
     
  38. DavidArts

    DavidArts

    Joined:
    Jan 19, 2017
    Posts:
    8
    Any help?
     
  39. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,595
  40. adithyakrishna

    adithyakrishna

    Joined:
    Nov 18, 2015
    Posts:
    1
    Hi Victor,
    Its a great assert, I have a problem using Joystick. I added joystick to the UI and was trying to make a full screen touch. So the player can touch anywhere on the screen to rotate (rotate FPS camera). I increased the joystick with and height to canvas size and changed the mode to Dynamic but nothing works.. how can i use Mouse X and Mouse Y also the joystick is not showing as I touch anywhere on the screen. It only shows in the place of JoystickBack.
     
  41. alarm656

    alarm656

    Joined:
    Jul 6, 2013
    Posts:
    107
    Hello all, I would be very thankful if someone can give me an idea, how can I control this model with this asset like 3rd person control. By using First person Demo in this asset. Снимок экрана 2017-06-25 в 14.35.19.png Thanks
     
  42. alarm656

    alarm656

    Joined:
    Jul 6, 2013
    Posts:
    107
    This asset has very cool First Person Controller, that I want to use it as 3rd person control. Like a game Shadowgun. I have another 3rd person controller with single joystick but it's not for shooter.
     
  43. Wacimo1996

    Wacimo1996

    Joined:
    May 20, 2017
    Posts:
    12
    Can someone tell us how to disable "UseMouse" option? I can't find it anywhere
     
  44. omid_221

    omid_221

    Joined:
    Aug 11, 2012
    Posts:
    2
    hi.please send tutorial for newb.cant find way to run on my project/
    i cant write code yet
     
  45. RoAtEr101

    RoAtEr101

    Joined:
    Apr 15, 2018
    Posts:
    1
    Hi there, Victor.

    I don't know if you're still replying to people here, but I would love some help.
    I just got your Touch Control KIT, and it seems like it is exactly what I need.
    I am trying to make a 2D iOS Platformer with a simple left and right movement, with maybe a jump option.

    I am very new to Game Development, and as such I have absolutely no idea how to implement the touch controls. I have looked at your 2D example, and I would like my game to be controlled like that.
    I clicked a video where you showed someone how to implement the controls into a 3D FPS game, but I can't find any of those options - and am growing very very frustrated.

    Is there a video for how to link the controls to my own character? I would very VERY much appreciate it.
     
  46. Victor-K

    Victor-K

    Joined:
    Nov 10, 2013
    Posts:
    208
    Hello RoAtEr101,

    The TCK Input works like as Unity Input.

    If Unity need Input.GetAxis("AxisName"), then for get it from TCK you need next:


    using TouchControlsKit;

    void Update()
    {
    float x = TCKInput.GetAxis("controllerName", EAxisType.Horizontal);
    float y = TCKInput.GetAxis("controllerName", EAxisType.Vertical);
    }
     
  47. W1ntermute

    W1ntermute

    Joined:
    Aug 24, 2014
    Posts:
    9
    Hi, Viktor!
    I'm trying to use GetAxis("Touchpad"), but there is a strange thing:
    1) I'm interacting with one finger.
    2) I'm using two fingers (enables zoom)
    3) I remove one finger, the other is staing on screen
    4) I'm interacting with remainig finger on the screen, and GetAxis("Touchpad") returns Vector3.zero. Only if I remove it and touch the screen again I will get actual coordinates with GetAxis("Touchpad"). Is this a bug or a feature?
     
  48. Victor-K

    Victor-K

    Joined:
    Nov 10, 2013
    Posts:
    208
    Hello W1ntermute,
    Touchpad can be work only one finger, like as old-school notebooks touchpad.
     
  49. AERR0W

    AERR0W

    Joined:
    Nov 19, 2018
    Posts:
    1
    Hi there, Victor.
    How i create a run option? i need to create a function in FirstPersonExample.cs? I do not understand how speed works in your script, thanks for this great asset.
     
  50. ahmed-yehia

    ahmed-yehia

    Joined:
    Sep 29, 2016
    Posts:
    4
    Hello @Victor-K ,
    I've been using the asset TCK-Lite for a while, but ran into a problem when trying to control an FPS Camera using the touchpad,

    Code (CSharp):
    1. Vector2  aimDirection = TCKInput.GetAxis("Touchpad") * touchSensetivityMultiplier;
    2.  
    3. rotationX += (aimDirection.x * TouchSenstivity.x );
    4. rotationY += (aimDirection.y * TouchSenstivity.y);
    5. //Do Other Stuff to look around
    It works fine and smooth until at some point another finger is pressed on the touchpad, then the rotation gets buggy and player rotates in a strange way,

    Assumption:
    Touchpad also listens to other touches on the screen>

    Expectation:
    Shouldn't it listen only to the first touch, and ignore other touches? We don't want to interrupt touches that change the axis value suddenly

    How can this be fixed?

    Thanks for your contributions!