float x = Mathf.PingPong(Time.time, 3);
float y = gameObject.transform.position.y;
float z = gameObject.transform.position.z;
gameObject.transform.position = new Vector3(x, y, z);
It moves the gameObject back and forth However Mathf.PingPong(Time.time, 3) put the gameObject at some other place in the scene.