Unity Tutorial 5

 Unity Tutorial 5

In this weeks tutorials I am starting a new game. First I had to create a new project then I had to download and import the tutorials starter files for this tutorial. Next I browsed around the asset folder before finally choosing my player, animals and food that I would use. I had to adjust the XYZ scale of the food so that it was easily seen.

Then I created a C Script and linked it to my player. I made a new public float; HorizontalInput. This is the same variable used in the other tutorials so I was already familiar with it. My player was now able to move from left to right. The next step in the tutorials was new. I learned how to keepmy player inbounds preventing it from falling off the side of the screen. I did this by writing an if-stetement.

Unity

Next I learned how to make my player throw foods to feed the animals by turning the player into a prefab. After linking the prefab with the player controller I linked it to the space bar using C Script. Then I made the animals prefabs aswell. I did this by adding the animals into a prefab folder. I created a Destroyoutofbounds script and then applied it to the projectile. I added some code making the prefabs no longer exist after leaving the screen.

After testing i came up with no difficulties. by spending more time on unity I'm becoming smother with the software.



Comments