Search Unity

UI *Jitter* Image moving looks worse than atari console, why?

Discussion in 'UGUI & TextMesh Pro' started by allenrobot, Apr 13, 2017.

  1. allenrobot

    allenrobot

    Joined:
    Mar 23, 2015
    Posts:
    10


    Code:

    #pragma strict
    var speed = 120;
    function Start () {
    }
    function Update () {
    GetComponent(RectTransform).transform.localPosition.x += (-1.0*speed)*Time.deltaTime;

    if(GetComponent(RectTransform).transform.localPosition.x<-400){
    this.Destroy(this.gameObject);
    }
    }

    V sync being turned off seems to fix me being able to see it happening but does this mean that there is no way anyone would be able to use v sync on for any unity created program?
     
    Last edited: Apr 13, 2017
    awsapps likes this.
  2. UziMonkey

    UziMonkey

    Joined:
    Nov 7, 2012
    Posts:
    206
    The frame rate in the Unity editor is often not right. Do a build, and I bet it'll be smooth.
     
    allenrobot likes this.
  3. allenrobot

    allenrobot

    Joined:
    Mar 23, 2015
    Posts:
    10
    Tested it, you are right. Thanks! I have built other things but never a direct linear motion such as this where the jitter was noticeable in the editor so much. It jumps really bad once now just after start of the build version but then no more jitter after that one time.
     
  4. UziMonkey

    UziMonkey

    Joined:
    Nov 7, 2012
    Posts:
    206
    There can be a lot of causes for this, but the process of loading the scene has probably created a lot of garbage and that's the first garbage collection cycle. Or some other thing you have no control over, adding a small intro screen or something so it's not so noticeable might be the way to go there.
     
  5. allenrobot

    allenrobot

    Joined:
    Mar 23, 2015
    Posts:
    10
    Same thoughts here.