Tutorial 3
In this tutorial, I learned how I can collectable objects to my game and how I can add a health stat to my character. I first had to add health to my character script, I also established the max health my character will be able to have and added it to my script. Now that I added max health to my character I learned how a 'trigger' works. Triggers are a special type of collider, they don't block the movement of the character but they still detect if the character collided with them. The triggers send the player a message if the character collides with them.
I created a collectable Heath game object and created a collectable script to go with it. I then gave my character health using the script.
In the next tutorial, I added a damage zone to my game, if my character collides with the damage zone the health will go down by -1. I then learned how to resize the damage zone. At the end of the tutorial, I added an enemy into the damage zone and created a new script called the 'EnemyController' which allows you to make the enemy go up and down in a loop.
Comments
Post a Comment