Skip to main content

UNITY TUTORIAL 02

Illustration from Pinterest.

This week I completed two more sets of tutorials for building Ruby's 2D Adventure. I added items such as trees, drains, metal cubes, flowers and more to my scene. To make it look like Ruby is standing in front or behind the items I changed the transparency mode in the camera settings to custom axis. I changed the sprite sort point to pivot and edited Ruby's custom pivot in the sprite editor so that the pivot is now placed at the bottom. Now it does not look as though Ruby moves in front or behind the items too early. I created a prefabs folder and added the items to it. This allowed me to easily add duplicates of the items to my scene. 

I added a RigidBody component to Ruby and changed the gravity scale to 0 to prevent her from falling out of the screen. I added a box collider to Ruby and the items, and adjusted the sizes. To stop Ruby from glitching and rotating when coming in contact with an item, I activated the freeze rotation in the RigidBody component and edited the RubyController script. I added a TileMap collider then changed the collider type of all the "land" tiles to none so that Ruby stops at the border when she tries to walk onto the water tiles. 

Screenshot of my progress in Unity.


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...