Object moves but position remains the same???

In my GameManager script I instantiate my ground from an array like so:

Instantiate(lands[0], landSpawn, Quaternion.identity); //ADD LAND

and I move the land like so in my LandController script like so:

void Update ()
    {
        transform.Translate(Vector3.left * speed * Time.deltaTime, Camera.main.transform);
    }

It works and the land moves. But in my GameManager script in the Update I’m trying to track the lands position like so:

            Debug.Log(lands[0].transform.position.x);
            if (lands[0].transform.position.x < 0)
            {
                Debug.Log("land pass x < 0");
            }

When I do this the Debug.Log just shows the object remaining at 0 (where I spawn it) even though it is actually changing position from my LandController script.

What’s going on?

So I get I need to store a reference to it like so:

GameObject newLand = (GameObject)Instantiate(lands[0], landSpawn, Quaternion.identity);

GameObject newLand = … is just for if you need to change something else for the object besides position and rotation. It does nothing if you don’t use newLand for something.

But i think the problem comes from using Camera.main.transform as the reference point for Translate, you shouldn’t need it.

Oh really? I will have to remove it and see what happens. Thank you for the reply.