2d scrolling background stuttering problem.

I am using the 2 camera approach to getting a pixel perfect 2d background that scrolls. One camera shows the GUITextures and one shows the 3d objects in front of the GUITextures. My problem is that the background stutters as it moves in the background. My goal is to make a tiled system so that is why I need more than just animate uv. Here is my code for moving two GUITextures. Any idea as to why the textures are stuttering as they move? Thanks.

#pragma strict

var xVelocity : float = 0;
var background1 : GUITexture;
var background2 : GUITexture;
var backgroundDamper : float = 0.5;

function Update () {
        // calculate the velocity over time and add it to each background image
	var xVel : float = -xVelocity*Time.deltaTime;
	background1.pixelInset.x += xVel;
	background2.pixelInset.x += xVel;

	// This readjusts the one that went off the left side onto the right side so it keeps on scrolling.
	if(background1.pixelInset.x < -1200){
		background1.pixelInset.x = background2.pixelInset.x + 800;
	}
	if(background2.pixelInset.x < -1200){
		background2.pixelInset.x = background1.pixelInset.x + 800;
	}
}


function adjustVelocity(xAdjustment : float){
	xVelocity += xAdjustment * backgroundDamper;
}

Sorry for bumping my own thread but does anyone know a better way to create a 2d scrolling background? Or how to move it over time?

It sounds like maybe you need to Mathf.FloorToInt or Mathf.CeilToInt somewhere ( maybe in the PreCull for the background camera ) assuming your using something orthographic and your going for center pixels.

You could do it on the camera position, or your pixelInset. either way you should get a copy of the data, apply the floor or ceil, keeping your original floating point data. so theres no stuttering

An interesting way to do this is like I did it on a space sim.

var backgroundOffset=-Vector3.up * 1000;
transform.position=Camera.main.transform.position / 100 + backgroundOffset;

I found a jittering problem when using real low numbers and real small objects on the background. (I was using / 10000 or so)