Friday, November 6, 2020

Unity Tutorial 05

 

This week’s tutorial has been interesting. We learned some features that made our game more game-like. I realized how more comfortable I was when working through the tutorials, especially with the scripts, I was able to recall some code we used in previous tutorials.

The lessons focused on creating a fast-paced runner game where the player needs to press the spacebar to jump in order to avoid obstacles which fly towards the player.

I got a bit insight on a different way to make game objects do different things. So far,  only the Translate () method was used to bring objects into our scene. However, to make the game seem a little more realistic I got a little more insight about Unity’s own physics engine which calculates the objects mass, external forces acting on that object and gravity which simulates real-life physics in the game.

In this tutorial, I had to use the AddForce method instead, which uses Unity’s physics engine to make the character’ jump force realistic.

Screenshot of my Unity tutorial.

The Sprite Render component is a new feature I was introduced which essentially rendrs images into the game and can be used to create the 2D background just the like the forest background used for this game. We were able to make it appear like the player was moving by applying a written move script to the background (kind of like looking out the window of fast driving car).

Another useful skill was to call other methods to target different game components. Before, we only used gameObject and Transform.

To control the character’s movement, gravity and other characteristics we used new method to be able to access other components which aren’t found on every game object such as the Rigidbody. To do that we used GetComponent method.

Finally, the more part was learning to do our first animations. Animation Controller with an unusual interface that looks similar to  a mind-map diagram. When viewing the game on play-mode, the diagrams will indicate what animation state the character is in. The parameters section allows use to control the length and speed of an animation. We also managed animation transitions in our scripts using if-statements to control when the character enters different animations states depending of what the player does e.g if player accidently hits the obstacle the character transitions from a running state to an animation where he is knocked unconscious.

This was a fun unit overall. Hopefully I’ll be able to remembers most of what I learned when it comes to making my own game.

No comments:

Post a Comment

Doing

  We are nearing the end of this semester and the book we’ve been working throughout the semester is in its final editing stages. This week,...