- Home /
Instantiate Object at the extreme end of the object
hello guys
I am developing 3D platformer game in unity 3D and I am using version 5. I search everything on internet but can't find proper solution so finally I am here to ask you guys. I have imported .fbx file in unity. .fbx file contains a big laboratory with scale of (30,30,30) I set in unity. what I want is as the laboratory moves from right to left and and player running on the floor of laboratory. When the laboratory's right end reach to the player the same laboratory I want to instantiate at the extreme end of the first laboratory. so It looks continuos. expect any kind of help or suggestion.
Here is my screenshot of laboratory
here is my simple code that moves my laboratory from right to left.
using UnityEngine; using System.Collections;
public class Laboratory_Loop : MonoBehaviour {
public GameObject Lab;
public float Speed = 5;
void Update () {
MOVE();
}
public void MOVE(){
Lab.transform.Translate(Vector3.left * Speed *Time.deltaTime, Space.World);
}
}