Movement jitter every few seconds

Hi All,

Project Link: Dropbox - New Unity Project 2D - Simplify your life

I am trying to move basic box objects from right part of the screen towards left with Lerp. I am testing it on my android (Galaxy S4) It moves smooth but every few seconds screen jitters or stutter which is very annoying.I have searched everywhere but no solid solution to this. With Vsync on its even worst.

I have also tried this with object pooling, still same jitter. PLEASE HELPPPPP

I have tried the following;

  • Update
  • FixedUpdate
  • LateUpdate

And for movement;

  • Translate
  • Lerp
  • Move forward

nothing seems to be working and any help would be appreciated.


using UnityEngine;
using System.Collections;

public class moveScript : MonoBehaviour {

private Vector3 newPosition;
public float speed = 10.0f;
private int randomNum;

void Update () {

	randomNum = Random.Range (0, 2);
	movers ();
	resetPosition ();


}

private void movers(){
	Vector3 posB = new Vector3 (transform.position.x - 5 * Time.fixedDeltaTime , transform.position.y, transform.position.z);
	newPosition = posB;
	transform.position = Vector3.Lerp (transform.position, newPosition, Time.smoothDeltaTime *  speed);
}

private void resetPosition ()
{
	if (transform.position.x <= -4) 
	{
		if(randomNum > 0)
		{
			transform.position = new Vector3(5.0f,-0.2f,0.0f);
		}
		else
		{
			transform.position = new Vector3(5.0f,0.2f,0.0f);
		}
	}

}

}

Try turning development build off. Profiling can help track down problem scripts and stuff but, it has a performance overhead since it sends data frequently. Also, in the profiler, click on the spikes and see what is causing them. My guess is the skipping will disappear when the profiler is no longer running.