Search Unity

Vector3.Lerp result in "laggy" movement while running on iOS devices

Discussion in 'Scripting' started by Mr_Cad, Jan 8, 2014.

  1. Mr_Cad

    Mr_Cad

    Joined:
    Dec 7, 2013
    Posts:
    27
    I know this question has been asked for many times but I've tried all the proposed solutions and none of them fix...

    Possible solutions that I've tried:
    1. Use FixedUpdate instead of Update
    2. Use smoothDeltaTime instead of deltaTime
    3. Use SmoothDamp instead of Lerp
    4. Use LateUpdate instead of Update

    Here's my codes
    Code (csharp):
    1. void Update()
    2.     {
    3.         time += (Time.deltaTime / duration);
    4.         if (time > 1.0f)
    5.             time = 1.0f;
    6.         Vector3 newPos = Vector3.Lerp(startPos, endPos, time);
    7.         transform.position = newPos;
    8.     }
    When I try to run it on iOS devices, it run very jaggy/laggy..
    I remember last time when I was using Unity 3.x, it doesn't has this problem.