I am trying to achive to load GameObject only if the player is 16 units from GameObjects position.
function Update () {
if (player.transform.position.x > 16){
Instantiate(chunk1, Vector3(30, 0, 0), Quaternion.identity);
}
}
but i have it in Update function so it keeps making new GameObjects if I am in that area.
and the instantiated object(s) is still there if I am not in that area. I dont have any more idea how to fix this.