Thursday, March 5, 2020

Unity Tutorial 6

So for this week of our Unity tutorials we looked at emulating a classic side scrolling game. For this tutorial we focused on creating a bigger sense of detail and quality by using things like sound, particle effects and additional animation.

After importing the template of the project the first thing we needed to do was to make a character jump (3.1). To do this we first imported a character into the game and positioned him so that he was facing the right way. Then we added a player controller script to the model for the next step. From there we use script to make the character jump whenever the space button is pressed. Then we messed around with the gravity in the scene to alter the height of the jump. To prevent the player from being able to win 100% of the time by spamming the spacebar we use "if" values to insure the player can only jump once. From there we added in our objects for the player to jump over and made it so that they spawn at intervals to make them endless.

In (3.2) we addressed an issue with the game, the background would just disappear if the player went far enough. To fix this made the background repeat itself and used script to make the transition more fluid looking. After that we wanted to add a game over trigger for when the player hits an object and loses, we did something very similar in our previous tutorials. We also made sure that when the player triggers a game over the rest of the game stops as well, including the objects spawning and the background continuing to move. To tidy things up we also used the "destroy" value that we used in previous games to delete the object once they move out of the scene.

Finally, in (3.3) we looked at adding animations to our character model, we messed around with the models animations before selecting the run animation and setting a speed for it, now he isn't just hovering along the map. Next we added the jump animation and adjusted it to make it smoother looking. Finally, we added the animation for when the player hits an object and "dies", there was a bug that made it so the player was able to jump from this position which looked funny but we got rid of it by adjusting the jump conditions. 

Source Unity

No comments:

Post a Comment