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 ?
 
                 
                capture.png 
                (17.4 kB) 
               
 
              
               Comment
              
 
               
              Answer by tanoshimi · Aug 04, 2016 at 10:30 AM
 transform.position = new Vector3(transform.position.x, initialPos.y, initialPos.z);
(line 23)
Your answer
 
 
             Follow this Question
Related Questions
Click Vector3 position to change color 0 Answers
I need help with the location of instatiated objects on the scene and correct interaction with this 0 Answers
List.Contains not working as intended 0 Answers
Bacteria/Cell Growth 1 Answer
gameobject transform position doesn't return the same vector3 2 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                