Search Unity

Input lag on moving finger fast

Discussion in 'Android' started by ammar26, Jul 3, 2015.

  1. ammar26

    ammar26

    Joined:
    Jun 5, 2011
    Posts:
    29
    I'm trying to create a fast pace game, in which user has to move finger on screen. But Android is showing me lag on touch input.

    I created a simple scene to test, in which a user move sphere with finger. If user moves his finger too fast, the object trails behind finger (follow the finger but is far away from finger). Does anyone know how I can reduce input lag on continuous touch input on Android

    Is there any option that i'm missing in player settings?

    My test update function
    Code (CSharp):
    1. void Update () {
    2.         if (Input.GetMouseButtonDown (0))
    3.             drag = true;
    4.  
    5.         if (Input.GetMouseButtonUp (0))
    6.             drag = false;
    7.  
    8.         if (drag) {
    9.  
    10.             float x = Camera.main.ScreenToWorldPoint (Input.mousePosition).x;
    11.             float y = Camera.main.ScreenToWorldPoint (Input.mousePosition).y;
    12.             transform.position = new Vector3 (x, y, 0);
    13.         }
    14.     }
     
    Last edited: Jul 4, 2015