- Home /
problem with instance
Hello everyone I wanted to achieve the effect of a background vertical continuous Move through (giving the feeling of going up). I decided to make a plane (with texure) and give the command to transition the y axis. When the plane reaches a certain coordinate should istaziarne a copy to give a sense of continuity. As for the instance I have no problems. The problem is that I clone to infinity. This is my code:
var planeBackground : GameObject;
var x : int = 0;
function Start () {
planeBackground = GameObject.FindWithTag("Respawn");
print(planeBackground);
}
function Update () {
//print(cameraMia.transform.position);
planeBackground.transform.Translate(0,0,-1*Time.deltaTime);
if(planeBackground.transform.position.y < 1.3){
print("CLONA");
}
}
I will rightly continue to clone because it reached a coordinated derminata will always be lower. How can I fix this? Thank you =)
Hi whay dont you move camera itself ins$$anonymous$$d and where is the instantiating part of the code
Answer by chucky831 · Feb 11, 2013 at 04:57 PM
hello, I did not understand what you mean. I applied the script to the room but must instantiate only one time the plan each time it reaches the coordinated established. Thank you for having responded to me =)