Skip to main content

UNITY TUTORIAL 05

Laptop with program code from Freepik.

In this week's Unity tutorials, I began making an endless side-scrolling runner game. The first set of tutorials showed me how to make the player jump by pressing the space bar as well as adjust the character's mass, jump force and the scene's gravity. I added an if-statement to the PlayerController script to prevent the player from double jumping. I learned how to make the background and obstacles move left towards the player as well as set the speed in which they move. I reapplied what I learned about making obstacles spawn from previous tutorials. 

In the second set of tutorials, I learned how to make the background repeat so it does not disappear along with the obstacles. I also learned how to make the background stop and have a "game over" message when the player comes into contact with an obstacle. I learned how to stop the obstacles from spawning after the player hits an obstacle. I edited the MoveLeft script so the obstacles would be destroyed once they are off the player's screen.

The third few tutorials introduced me to the player's animation controller which include different states and transitions. I edited the animation controller to allow the character to run in a static position. I added a jumping animation so the player is not running when in the air. I learned how to make the player fall over when they collide with an obstacle and how to prevent them from being able to jump when unconscious. 

This week's tutorials were easy to follow. I found the animations interesting and they made the game look more realistic. Some of the skills I learned in these tutorials can be applied to my own project because I will be making an infinite runner game.

Comments

Popular posts from this blog

FIRST PLAYABLE

Continuing with the creation of my game, I resized the player character to make them even smaller based on a comment that was left on my last project blog. I also repositioned the trees to make the space slightly narrower and added some flowers to bring some colour into the scene. With reference from the animal feeding game tutorial, I was able to get the player moving left and right by clicking the arrow keys. I brought in rocks and a branch for obstacles but I need to apply a SpawnManager script and get them to spawn randomly during gameplay. I also have to figure out how to get some branches falling from the trees and bringing in power-ups and points too. Screenshot from Unity3D of my game production.

PROTOTYPE

I browsed through the Unity asset store to find a package with nature objects that I could use to set up the scene for my infinite runner game. I downloaded the Nature Starter Kit 2  and started building my scene in Unity. This was a little time consuming but I'm satisfied with the way it turned out. I upscaled the trees and bushes, keeping in my mind my initial idea of gaining inspiration from the movie "The Secret World of Arrietty." I got the character from a tutorial I have completed for this module before and positioned the camera behind it. Screenshot of my work in Unity3D. With reference to the lesson 3 Unity tutorial, I started coding by creating the PlayerController script. I used the AddForce method and allowed the player to jump by clicking the spacebar. I declared two public variables to be able to adjust the gravity and player's jump force. Looking into the player's animator controller, I applied a static running animation. I then added a jumping ani...