Firstly, this is the script I'm using:
var object: GameObject;
private var obj: GameObject;
function OnTriggerEnter(other: Collider)
{
if (other.tag == "Player"){
obj = Instantiate(object, Vector3(0, 0, 0), transform.rotation);
}
}
Now, with this script, when I enter the Trigger, the Prefab is being instantiated in front of my initial Prefab, just like I wanted it...but when I move to my instantiated Prefab, when I enter the Trigger, the prefab is not being cloned in front but at the same position like the last one.
My game is an endless runner, so I need the spawned prefab to always be one tile further of my last prefab. How can I do this?!
Here's a sketch of the situation, if I'm not being quite clear with you guys