Walker Boys Studio – Unity Training – Lab 1

This is a post related to Unity 3D and Walker Boys Studio’s free tutorials. I decided to start learning Unity and follow with the amazing tutorials created by them.

You can read more about this first lab by following this link: Walker Boys Studio – Unity Training – Lab 1.

If you want to see my result (a nice small game called “Point and Click”) please click on the image below.

Note that this is not intended to be a complete working game, it has been created in order to learn basic game development in Unity 3D. More complicated projects will follow but, for now, the target was to learn only the basic stuff.

Project Description

Student Name

Marcel Corbeanu, from Romania :-) .


20.05.2011 – 23.05.2011

Previously to that I spent about 6h:15 (about 2 weeks ago) to look at the lab videos.

Project Details

As you’ll see from the last section of the document, I took my time and decided to study (again) parts of the documentation, try different approaches and experiment with Unity’s Javascript.

I’ll try to discuss below my solutions to each of the 4 homeworks. Note that, just for the fun of it, I started with the last one :-) .

1. Blinking Sphere
I used a public variable called “isBlink” (available in scriptEnemy.js) in order to tell the program which Game Object should blink and which should not blink.
The actual count down was done with an InvokeRepeating() function; each 0.2 of a second I call a function called “Blink” and, inside that function, I make sure that I hide (or unhide) both the Sphere and the 3D Text. Also, inside that function, I update the counting down text.
The counting down text was done by creating a child object to the Sphere and altering, by script, it’s TextMesh.text property. I also used a custom Shader because, by default, the 3D Text will always stay above all Game Objects in the scene (and I didn’t wanted that to happen). I found the custom Shader solution on unifycommunity.com and I used it with a free font (Gunplay).

2. Moving Cube
The moving Cube script is done using Vector3.Lerp(). When the game starts I generate a new screen position (making sure it’s inside the safe area so the Game Object will not move out of the screen) and then I tell the Cube to interpolate to the end point (Vector3.Lerp()). At the end of the 1st movement I generate a new end point and so on. The Cube will never stop moving.

3. Random Spawn Time
I used a public variable called “isRandRespawnTime” (available in scriptEnemy.js) in order to tell the program which Game Object should have a random spawn time. Based on that value (true/false), the script will return either a random value or the standard value.

4. Extra Credit: Making the Sphere move in a circular pattern
I used, yet again, an Inspector variable called “isCircularMoving”, designed to tell the script which Game Object should have a circular movement, if any.
The circular movement was done using Transform.RotateAround().
As a note, I made sure that the 3D Text will not rotate while it’s parent (the Sphere) is rotating so I used on it the following statement: Transform.rotation = Quaternion.identity.
The same line of code was used to make sure the main Game Object (in this case, the Sphere) will not rotate around it’s axis. You can’t see it but, if instead of a Sphere we decide to go with a Cube, that Cube will also have a rotation around it’s axis and this is what I wanted to avoid :-) .
Also, regarding the circular motion, I made sure the Sphere will always rotate towards the center of the screen so that it’ll not go outside of it at any it. As with the Moving Cube part, I made sure that the random generated position of the Sphere is always inside a safe margin. This will not allow the Sphere to go out of the screen while rotating on a circle that has the center orientated towards the center of the screen.

Software Used

  • Unity 3D
  • Adobe Soundbooth CS5

Final Thoughts

First of all, I think you did a great job creating all the initial tutorials, the exams and the lab projects.
It was a great experience to have the chance to study and learn in a professional way.
Hopefully, I’m ready to move forward, to the next lab.

Some thoughts …

I wanted to write clean code and I hope I managed to do this. Also, I defined several new variables and maybe (I’m not really sure) I renamed 1 or 2 of the “original” variables.

Also, I’m used to break down the code into as many functions as possible (and as simple as possible) so I may have created several “new” functions along the way.

I created only one new script file, scriptMoveCube.js. For the other stuff, I decided to include the code inside the scriptEnemy.js file, by exposing some variables in the Inspector and, based on true/false, apply different “options” to different Game Objects.

Some notes & ideas …

I took care of the problem where you can “kill” again an object even if it’s hidden away using renderer.enabled = false.

I took care of the part where the Sphere and the 3D Text would rotate around their own axes, the Prefab is now rotating only around the center point.

I wish Unity had constants 😀

I’m not sure if my solution to create the “isSomeNameHere” variables (see Project Details) was the best one. Another aproach would have been to create different script files, like I did with scriptMoveCube.js. But since it wasn’t specified in the description I thought it’s not a bad idea.

I think I spent too much time on such a simple project but I wanted to be sure that everything is working great.

Break down your Time

  • Research
    • 6h:15 – looking at the videos for the 1st time
  • Art
    • aproximately 1h:00 – also looking at some of the videos for the 2nd time
  • Design
    • aproximately 3h:00 – enemies, menues, and GUI, along with some coding there
  • Coding
    • 3h:00 – rest of the coding for the game, along with looking the 2nd time though the lab videos
    • 12h:00 – all 4 homeworks + different testing; also reading (again) some of the docs and the forums :-)
  • Playtesting
    • aproximately 2h:30 in the last 2 days. I also tested much during coding (I’m used to do this).

Thank you again for all your work in putting together the huge list of videos and the documentation for the tutorials, exams and labs.

Filed in: English, Unity 3D
Tags: , , ,

Related Posts

Bookmark and Promote!

Leave a Reply

Submit Comment