Unity: Ruby's Adventure Lesson 4/5

Continuting on with: Ruby's Adventure: 2D Beginner - Unity Learn

We added the cinemachine (camera) package and added a cinemachine which allowed us to have a camera which follows the character. We also added a constraint which made it so that the camera doesn't show areas outside of the map. 

We also added particles to the broken robots and when ruby gets hurt. 

UI (HeadsUpD and title screen + changing scenes)

For UI we first learnt a bit about the Canvas which is the container for UI elements. 

Constant pixel size makes the canvas content stay the same size, scale with screen size changes the size of content depending on the screen. 

To view the Canvas you can click f in the scene while the Canvas is selected. This shows that the canvas is much bigger than the game area because scene view handles UI postions/sizes differently. 

Within UI, Rect Transform is used. You can change anchors and pivots within this, which changes how the UI is positioned/moved/scaled.

We added a health bar UI, this used a mask to hide/reveal the health bar image depending on how much health Ruby has. When adding to the script we had to add a line at the very top to say that we would be using UI classes, so that we could call them in the script. 

I also went onto the next chapter where I added a ray to Ruby which could be used to identify if something was infront (in this case the Npc) and I also added the NPC 'Speech bubble' which appears when you click X infront of the NPC. 

We also went through how to make a Title screen (which isn't in the Ruby tutorial), to do this we added a sprite called 'Scene manager', added a script and then added the open scenes within the build settings to assign a number to them. We then assigned the LoadScene(); function to the button when it is pressed. This changes the scene. 


What I have made for my game so far are some grass/dirt tilesets. 

Made in photoshop by me.


My idea for my game is to make something nature based, along the lines of a cat traversing a forest to find it's way home. With rain as an enemy prehaps, as well as maze/challenge sort of elements and collectables. 

A moodboard of game art that I am taking inspiration from and might use if I don't have enough time to make all my own assets.


Comments

Popular Posts