Search Unity

[Closed] touch input

Discussion in 'Community Learning & Teaching' started by ks9109, Nov 28, 2015.

Thread Status:
Not open for further replies.
  1. ks9109

    ks9109

    Joined:
    Jun 25, 2013
    Posts:
    56
    I'm using an asus two In one touchscreen I'm not sure whats happening but its not recognizing my touches on play. Any help?

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class TouchTest : MonoBehaviour
    5. {
    6.     void Update ()
    7.     {
    8.         Touch myTouch = Input.GetTouch(0);
    9.        
    10.         Touch[] myTouches = Input.touches;
    11.         for(int i = 0; i < Input.touchCount; i++)
    12.         {
    13.             //Do something with the touches
    14.             Debug.Log("touch");
    15.         }
    16.     }
    17. }
     
  2. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
Thread Status:
Not open for further replies.