How do I control the transform.position of an instantiated prefab?

I am trying to make a road that will spawn itself as my player runs along it. Currently I have this:

var spawnThis : Transform;

    function OnTriggerEnter (other : Collider)
    {
    	Instantiate (spawnThis, transform.position, transform.rotation);
    	Destroy (gameObject);
    }

it’s the Instantiate line I am having trouble with, it just spawns it in the same place as the first object was, I want it to spawn at the next position.x integer. I was hoping something like this:

Instantiate (spawnThis, transform.position.x ++, transform.rotation);

except that returns this error:

No appropriate version of
‘UnityEngine.Object.Instantiate’ for
the argument list
‘(UnityEngine.Transform, float,
UnityEngine.Quaternion)’ was found.

How can I go about this?

I think i’d have just made a variable and stored the instantiated game object in it, that way you can just call the variable and do what you want with it, transform.position, or even rigidbody stuff…

var spawnThis : Transform;
var newSpawnThis;
var speed;
 
    function OnTriggerEnter (other : Collider)
    {
        newSpawnThis = Instantiate (spawnThis, transform.position, transform.rotation);
        newSpawnThis.position.x += speed;
        Destroy (gameObject);
    }

that should work, right?

You can do something like this:

   function OnTriggerEnter (other : Collider)
    {
        var v3 = transform.position;
        v3.x += distance;
        Instantiate (spawnThis, v3, transform.rotation);
        Destroy (gameObject);
    }

…where ‘distance’ is either a variable you define or a hard-coded value.