Unity Tutorial 03 (Semester 2)
(Image of enemy from the tutorial) For this weeks Unity tutorial I continued on with my Ruby's Adventure tutorials that I have been doing since the beginning of the semester. At this point I had my world set up but this week I had to make it possible for Ruby to collect items such as health packs. First off I had to give Ruby some health. To do this I had to add a health variable to my script. After this I had to add a new variable called a function in order to change my characters health. I had to add the following code: void ChangeHealth(int amount), currentHealth = Mathf.Clamp(currentHealth + amount, 0, maxHealth); Debug.Log(currentHealth + "/" + maxHealth); After I did this I was able to see Ruby's health in the console window. I then had to make it possible for Ruby to collect health. To do this I had to find the CollectibleHealth object in my assets folder and add it to my scene. I then had to adjust the PPU value to the right size. I then had to add a box colli...