Unity Tutorial 5

 Unity Tutorial 5

This week we continued on with the endless runner from the unity task from the week before. The task this week was to make it look like the player model was moving when in fact it was actually the background moving instead. We were also shown how to make the background move then repeat again.

 We were also tasked with having the background stop if the player bumps into an obstacle this was done by having the player controller script and the repeat background communicate to each other. So once the player controller script detects that the player has hit an obstacle it then communicates to the repeat background script and tells it to stop.

For the repeat background  we created a repeat background script and added it to the background which made the background play from the start point and once it reached the end it would return to the beginning and repeat over and over again. We did this by using the transform position along the x axis to find out where the background ended so we knew where to rest it.

An if statement was then used to communicate with certain aspects like the background and objects spawning in front of the player. So if the player hits an obstacle the background will stop and obstacles will stop spawning in front of the player so it appears as a game over. 

As I said the week before I will definitely going back on these tutorials while creating my own game which is an endless runner which falls into the same category as the tutorials we have been doing for the past couple of weeks

 

Comments

Popular Posts