hi,
am doing a top down platform game, where i have two quads as road, which i have to reuse it by changing its position back to origin when it moves out of camera.i have already done a basic movement script for this but i get empty space between the quads when each one moves to the origin. need help on how to make the platform reusable or is there any other technique to achieve this sort of movement. the script is below.
using UnityEngine;
using System.Collections;
public class roadScript : MonoBehaviour {
public float speed = 2.0f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
transform.Translate (Vector3.down * speed);
if(transform.position.y < -142.0f)
{
transform.position = new Vector3(0.0f, 201.0f, 25.0f);
}
}
}