#pragma strict
public var local:boolean = true;
public var unitsPerSecond:Vector3 = new Vector3(1,0,0);
public var mod:Vector3 = new Vector3(100,0,0);
function Start () {

}

function Update () {
	if(local){
		transform.localPosition+=unitsPerSecond*Time.deltaTime;
		if(mod.x!=0)transform.localPosition.x = transform.localPosition.x % mod.x;
		if(mod.y!=0)transform.localPosition.y = transform.localPosition.y % mod.y;
		if(mod.z!=0)transform.localPosition.z = transform.localPosition.z % mod.z;
	}else{
		transform.position+=unitsPerSecond*Time.deltaTime;
		if(mod.x!=0)transform.position.x = transform.position.x % mod.x;
		if(mod.y!=0)transform.position.y = transform.position.y % mod.y;
		if(mod.z!=0)transform.position.z = transform.position.z % mod.z;
	}
}