Thursday 14 November 2019

Unity Free Tutorials

Unity Free Tutorials


For this week's Unity tutorials, we were tasked with finding 2-4 of our own tutorials to follow. I really liked doing this- as it gave me a chance to develop something for my game project.

This week I looked at some tutorials by Jimmy Vegas for creating a main menu, along with functioning buttons including a play button that loads the player into a scene of choice.
I thought I would stick to Jimmy Vegas tutorials this week as he is using the same version of Unity as I am, and his tutorials are clear and easy to follow (at least to me).






These are the two tutorials I followed.


I started off with creating a new scene in my project for the main menu. Using the UI GameObject, I created text which reads the title of my game, "Eterna Hunt". I then added a side bar and bottom bar and anchored them to the menu, and made them semi-transparent so that you could see the scene behind it which I made later. Using the button option, I created three buttons, one with "Play", "Options" and "Quit Game". 

This is where the tutorial got a bit confusing- Jimmy went on a bit of a tangent about the importance of text and button colour as some colours make a glitch where the button functionality doesn't work- so I just followed his advice and din't make my button black. I made sure to change the colours for when the button is hovered over and clicked to help distinguish it. 

I then went on to create a mini scene reminiscent of my main world- I built a terrain behind the main menu and made some mountains and painted textures and trees, and also moved the main camera to look down on the scene so that you wouldn't see any clipping.


Main menu demonstrating button hovering change
Source: My Unity project


The next step of this tutorial was to add functionality to the buttons using C#. 
As I find C# very confusing to follow and understand, I downloaded the script from Jimmy Vegas' website and applied it to my buttons, tweaking the code to remove buttons I didn't feel were necessary to include in my game which Jimmy did in his game, and to change the linked scene number to ensure the right scene would be opened when the play button is pressed.

And.., it worked! For once. 


What happens after you press the play button
Source: My Unity Project



I removed the trees from my world to reduce lag- I'm going to make the map smaller when I work on developing my game further during the weekend before I add them back.


I was so happy and satisfied seeing my world pop up when the play button is pressed, since C# tends to want to fight me and not work. Pasting the code provided by the tutorial definitely helped me in this regard and it's safe to say I'll be doing it for every script I have to make from now on.

The options and quit game button aren't functional yet, but I'll tackle it when I develop my game more during the weekend.

I'm looking forward to developing my game more, as seeing things come together is really satisfying for me!

1 comment:

  1. Hello again Kayleigh,I just read through your Unity free tutorials and I really enjoyed it.i liked getting to hear how your constructed your world and how you wanted everything to go where, its all very fascinating. I like your addition of the main menu to your game. I have yet to add one myself so I will be sure to do it thanks to your inspiration. Overall, your post is great.

    ReplyDelete

Unity Tutorial 06

Unity Tutorial 06 Lesson 3.1 - Jump Force This tutorial was relatively easy to follow, however I encountered some coding problems...