How to reset position along z and y axis but maintain position on the x axis ?

my project is a 2d plane flying. I would like to maintain an infinite background so i used this script to reset the plane to it’s initial position when reaching a certain point along the Y axis. It works well to reset the position but i need it to reset only the Y and Z axis and not on the X axis how can i change my script to fill this ?75453-capture.png

transform.position = new Vector3(transform.position.x, initialPos.y, initialPos.z);
(line 23)