trying to make infinte runner,but cannot position tracks.

hey guys,
am trying to make infinte runner with 3 tracks,
adding 1st to end of 3rd when player passes trigger of 1st track.
all three triggers at end are child of that track.
but tracks are positioned at random position
also tried subtracting or adding values but to no vail as below.

my code::

using UnityEngine;
using System.Collections;

public class loop : MonoBehaviour {

public Transform stage1;
public Transform stage2;
public Transform stage3;
public Transform trigger1;
public Transform trigger2;
public Transform trigger3;
public int speed=10;

// Update is called once per frame
void Update()
{
	transform.Translate (0, 0, .5f);
	
}
void OnTriggerExit(Collider other) 
{
	if (other.name == "trigger1") 
	{
		stage1.Translate (0, 0, (stage3.position.z+100	 )  );
		Debug.Log("stage3="+stage3.position.z);
		Debug.Log("stage1="+stage1.position.z);
		Debug.Log("trigger1="+trigger1.position.z);
	}
	if (other.name == "trigger2") 
	{
		stage2.Translate(1, 1, stage1.position.z + 100  );
		Debug.Log("stage2="+stage2.position.z);
		Debug.Log("trigger2="+trigger2.position.z);
	}
	if (other.name == "trigger3") {
		stage3.Translate(1,1,stage2.position.z + 100);
		Debug.Log("stage3="+stage3.position.z);
		Debug.Log("trigger3="+trigger3.position.z);
	}
}

}

i think translate wont work if there is no rigidbody attached to the object. have u tried simply snapping them into position using transform.position ?

You need to

  1. place the entirety of a single track in a single game object, that way you can move an entire track by just transforming 1 root transform (I’m assuming there’s going to doodads and artwork attached as separate GameObjects.
  2. Place by hand a GameObject both at the beginning and end where one track meets another and have access to them in the script. Again, these are going to belong to the parent GameObject mentioned above in requirement 1.

Then when attaching the beginning of TrackB to the end of TrackA, find the difference between where TrackB is in the world, and where you want it to be, and move it by that much…

TrackB.transform.position += TrackA.TrackEnd.transform.position - TrackB.TrackBegin.transform.position.

I did this without using parallax by spawning objects at certain positions and then destroying them after they passed the main camera(this is good if you are making a mobile game).I just atached to the pictures a rigidbody and gave them velocity to move in that direction.If you do this you just have to time them perfectly to spawn one after another.