How I can change my game object position.x in current position?

I have a column and I want to change it position.z to -100 when it arrived to position.x 7
my code is not working and her he is … any help

using UnityEngine;
using System.Collections;

public class Column : MonoBehaviour {
public float coulmnSpeed = 0.1f;
Vector2 tempPos;
public Transform coultransform;
bool arrived;
void Start () {

}

void Update () {
	tempPos = transform.position;
	tempPos.x = tempPos.x + coulmnSpeed;
	transform.position = tempPos;
	if (coultransform.position.x == 7 && arrived == false) {
		arrived = true;
		Debug.Log ("out");
		tempPos.x = tempPos.x - 100;
	}

}

}

You’re moving transform.position to the right by columnSpeed each frame.

You’re testing whether coultransform, a different variable, ever reaches .x == 7…

You will have to assign the tempPos variable to your position.z after you change the value

 void Update () {
     tempPos = transform.position;
     tempPos.x = tempPos.x + coulmnSpeed;
     transform.position = tempPos;
     if (coultransform.position.x == 7 && arrived == false) {
         arrived = true;
         Debug.Log ("out");
         tempPos.x = tempPos.x - 100;
// Assigning the variable the position of the transform
         transform.position = tempPos;
     }
 }

Hope this helps