Unity Tutorial 6
Unity Tutorial 6
For this week's tutorials, I learned how to repeat my background. I began by making a new script. I attached it to my background object by dragging it to the inspection side. Next, I had to redo the background in order to create the illusion of an infinite road. I did this by making a new variable and assigning it a transform. positon. Then with a box collider, I made the loop created in the script look seamless.
Unity |
Then by making a new script I made the background stop once it triggers the game over. I made a new private player controller script. Then I wrapped the translate method in an if-statement. Then I stopped the obstacle from spawning. Lastly, I added an if-statement to destroy any obstacles
that exit the bounds of the screen.
Comments
Post a Comment