Roll a Ball Tutorial

I’ve now finished the Roll a Ball tutorial and feel a little more familiar with Unity, what can be done in it, and what I may want to do for the walking simulator game we were told we should start thinking about.

The videos for the tutorial were clear and concise, although I’m still getting used to the controls. I applied the things I’d learned just by toying around with Unity, such as putting in small assets, editing the camera settings, and worrying about the physics and rigid body. The newer things we get to learn through this tutorial were how to pick up objects, but also the vague idea of applying triggers in a game, adding a score counter, what effect gravity or physics can have one different aspects in the game, creating prefabs, and so much more.

The notion of physics in Unity is probably what took the longest to understand, including why the pick up items would fall through the ground. The best tip to keep in mind from the video was that all of Unity’s primitive objects (cubes, spheres, capsules, etc.) have the same size: either 1 x 1 x 1 or 1 x 2 x 1 Unity units. So all you have to do is move the object’s Y axis up by 0.5 units to know it’s then resting on the plane.

One of the other most important things I learned through this exercise is keeping all items in the hierarchy and the project folder in order. While this may have been a simple game, itĀ still proved how essential it is to name your items and organise your folders. I think for bigger games, it would be impossible to remember where and what everything is if you don’t start keeping things organise at the very start of the project.

player-inspector

I feel like components were the most interesting thing to learn about, especially since Unity has such an extensive library full of explanations and example of what the components can do. All you have to do is click on the small ? blue book to the top-right of the component to open up a web browser and then read.

The tutorials did capitalise on this, along with copy/pasting codes from these references then altering them for your own usage. In the beginning, I’ll be using this a lot, because trying to remember all the C# codes and what they do would be impossible until I’ve had more practice!

To the left here is what my Player itemsĀ (the small sphere you roll around in the game) looked like once I was finished.

The script-writing is something I’m so excited about, since I do want to do more programming than drawing/modelling in this course. While I know Unity can use JavaScript, the tutorial went through C#. Breaking down the script and what each part does is even more interesting. For the Player item about, here is the script that I ended up with:

playercontroller-script

I’m anticipating that already so much of this script will be useful when we start building our walking simulators, such as picking up items in a game, putting in triggers (the example given was when the player walks through a door and spiders drop down), or even displaying text on the screen when something happens (like maybe a journal is updated).

finished-roll-a-ball-screengrab

There isn’t much point in trying to show the game (I don’t think I could on this blog anyway), since it looks like it does in the tutorial, but I’m happy with the final product. The game works fine after being exported, although I did make the silly mistake of working off my USB stick rather than moving my game files onto my computer and then finishing the tutorial. In future, I’ll have to remember to back up files regularly, keep my project folder organised, and don’t work off a USB stick.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s