how can i use the curent position of an object?

void Update()
{
transform.position =new Vector3(Mathf.PingPong(Time.time*movespeed, 3), transform.position.y, transform.position.z);
}

My probleme is that when i press play the cubes that i use moving to the midle of plane and not on the position i set them.

float x;
void Start(){
x=transform.position.x;
}

 void Update()
     {
         transform.position =new Vector3(Mathf.PingPong(Time.time*movespeed, 3)+x, transform.position.y, transform.position.z);
     }

Well if you don’t want the object to move, I would take out the Mathf.PingPong function in the transform.position. That is what is making the object move.

If this solved your problem please accept my answer. If not, feel free to ask more questions!