Unity 3D Game Development by Example is Now Available for Pre-Order

Omigosh! i haven’t been THIS excited since that truck full of (inexplicably) fully-inflated bouncy castles collided with that shipment of Nerf guns on the highway. The first book that i ever paid unskilled labourers from the Philippines to write for me, Unity 3D Game Development by Example, is now available for pre-order on the Pack Publishing website!

Of course, the cover is still a work in progress. i’ve made a few suggestions to the publisher of what i’d like to see. For example, here’s a mock-up of the cover with a cat singing karaoke:

Nice job, Karaoke Cat, but it was a bit pitchy towards the end.

i’ve written a FAQ for the book. At last, all your burning questions will be answered:

What is Unity 3D?

Unity 3D is a game engine that’s been around for only a few years, but is rapidly gaining steam. It’s a tool that enables you to create your own 3D (or, with effort, 2D) games. You can deploy your games to the browser. That’s right: after a quick ~3MB plugin download, people can play your full 3D game right inside the browser, without having to download and install an .exe. If you want people to visit your portfolio site and play your games instantly, Unity 3D is the tool for you.

Can I Only Deploy to the Web?

No – the main Unity engine allows you to create standalone game files that will run on PC and Mac. If you purchase additional licenses, you can target the iPhone/iPod/iPad and WiiWare. Upcoming support has been announced for Android and Xbox Live Arcade (but keep in mind that you’ll still have to be a developer in good standing with Nintendo or Microsoft to develop for their consoles – it’s not a path you’ll likely take if you’re a hobbyist.)

How Much Does Unity Cost?

There are two versions of the core engine. Unity is free, while Unity Pro costs. Unity lacks a few features of Unity Pro, most notably real-time shadows and video playback support. (note: this lack of features is definitely not something that would get a beginner in much of a twist.) Games created with Unity are prefaced with a Unity-branded splash screen. You can check out a Unity license comparison grid here.

Beyond those restrictions, you’re free to make as many games as you like with the free version of Unity without paying a single cent to the engine authors. This is in contrast to UDK (Unreal Development Kit), Unity’s main competitor, which starts clawing back cash at (comparitively) alarming rates if you sell a certain number of copies.

I like Flash. Will I Like Unity?

Oh, yes! There are many similarities between the two programs. The biggest difference is that Flash is a content creation tool that people manhandle to the point where you can make games with it, while Unity 3D is a dedicated game engine. That means that it includes a lot of game systems right out of the box: physics, collision detection, 3D rendering and particle systems, to name a few.

Check out our Five Common AS3 to UnityScript Translations article in our Unity Nuub section.

What’s in the Book?

Unity 3D Game Development by Example contains lessons, code and art assets to build four very simple games in the engine: a keep-up game, a catch game, a memory game and a space shooter. These lessons are written in very plain language with lots of analogies and plenty of pictures, so that readers who have never coded or used a game engine in their lives will be able to get these projects off the ground. Certain elements, like the three countdown clocks in Chapter 7, are presented as standalone pieces that you can integrate into your games as you like. The book teaches you how to build standard game bits – title screens, buttons, timers, collision scripts, sound effects triggers, and endgame scenarios – that you can remix into your own projects.

Is This Book Appropriate to Use as a Text Book for my College or High School Game Design Program?

Absolutely. Please contact Packt Publishing for volume sales.

Is It Available As an e-Book?


I Enjoy Murdering Trees. Is It Available as a Book Book?


What Language is the Book Written In?

English, currently. All code examples are in javascript. Unity supports three different languages: javascript, C# and BOO. i chose javascript for the book because most of the online examples and tutorials i’ve come across are in javascript. It’s probably the best choice for a beginner.

What’s the Difference Between This Book and Unity Game Development Essentials by Will Goldstone?

Will’s also written a great beginner book – the first Unity 3D book on the market – that you should definitely check out. Will’s book contains one large open-world project with a number of smaller activities inside of it. My feeling was that open-world games open a whole can of worms that could potentially overwhelm someone new to Unity (what happens when you walk out into the water? What if you get stuck inside a volcano?). My focus was on keeping things simple and manageable, so that you can start with a very controlled and fully-functional project, and ramp up from there as your skills increase.

What’s the Difference Between This Book and an Riding Down an Exhilharating Waterslide on the Back of a Unicorn?

Not much.

Preface and Chapter Listing

By request, here is an excerpt from the book’s Preface:

“Game Developer” has rapidly replaced “firetruck” as the number one thing that kids want to be when they grow up. Gone are the days when aspiring developers needed a university education, a stack of punch cards, and a room-sized computer to program a simple game. With digital distribution and the availability of inexpensive (or free) games development tools like Unity 3D, the democratization of game development is well underway.

But, just as becoming a firetruck is fraught with perils, so too is game development. Too often, aspiring developers underestimate the sheer enormity of the multidisciplinary task ahead of them. They bite off far more than they can chew, and eventually drift away from their game development dreams to become lawyers or dental hygienists. It’s tragic. This book bridges the gap between “I wanna make games!” and “I just made a bunch of games!” by focusing on small, simple projects that you can complete before you reach the bottom of a bag of corn chips.

What this book covers

Chapter 1, That’s One Fancy Hammer!, introduces you to Unity 3D—an amazing game engine that enables you to create games and deploy them to a number of different devices, including (at the time of writing) the Web, PCs, iOS platforms, and WiiWare, with modules for Android and Xbox Live Arcade deployment in the works. You’ll play a number of browser-based Unity 3D games to get a sense of what the engine can handle, from a massively-multiplayer online game all the way down to a simple kart racer. You’ll download and install your own copy of Unity 3D, and mess around with the beautiful Island Demo that ships with the product.

Chapter 2, Let’s Start with the Sky, explores the difference between a game’s skin and its mechanic. Using examples from video game history, including Worms, Mario Tennis, and Scorched Earth, we’ll uncover the small, singular piece of joy upon which more complicated and impressive games are based. By concentrating on the building blocks of video games, we’ll learn how to distil an unwieldy behemoth of a game concept down to a manageable starter project.

Chapter 3, Ticker Taker, puts you in the pilot seat of your first Unity 3D game project. We’ll explore the Unity environment and learn how to create and place primitives, add Components like physic materials and rigidbodies, and make a ball bounce on a paddle using Unity’s built-in physics engine without ever breaking a sweat.

Chapter 4, Code Comfort, continues the keep-up game project by gently introducing scripting. Just by writing a few simple, thoroughly-explained lines of code, you can make the paddle follow the mouse around the screen to add some interactivity to the game. This chapter includes a crash course in game scripting that will renew your excitement for programming where high school computer classes may have failed you.

Chapter 5, Game#2: Robot Repair, introduces an often-overlooked aspect of game development: “front-of-house” User Interface design—the buttons, logos, screens, dials, bars, and sliders that sit in front of your game—is a complete discipline unto itself. Unity 3D includes a very meaty Graphical User Interface system that allows you to create controls and fiddly bits to usher your players through your game. We’ll explore this system, and start building a complete two-dimensional game with it! By the end of this chapter, you’ll be halfway to completing Robot Repair, a colorful matching game with a twist.

Chapter 6, Game#2: Robot Repair Part 2, picks up where the last chapter left off. We’ll add interactivity to our GUI-based game, and add important tools to our game development tool belt, including drawing random numbers and limiting player control. When you’re finished with this chapter, you’ll have a completely playable game using only the Unity GUI system, and you’ll have enough initial knowledge to explore the system yourself to create new control schemes for your games.

Chapter 7, Don’t be a Clock Blocker, is a standalone chapter that shows you how to build three different game clocks: a number-based clock, a depleting bar clock, and a cool pie wedge clock, all of which use the same underlying code. You can then add one of these clocks to any of the game projects in this book, or reuse the code in a game of your own.

Chapter 8, Ticker Taker, revisits the keep-up game from earlier chapters and replaces the simple primitives with 3D models. You’ll learn how to create materials and apply them to models that you import from external art packages. You’ll also learn how to detect collisions between Game Objects, and how to print score results to the screen. By the end of this chapter, you’ll be well on your way to building Ticker Taker—a game where you bounce a still-beating human heart on a hospital dinner tray in a mad dash for the transplant ward!

Chapter 9, Game#3: The Break-Up is a wild ride through Unity’s built-in particle system that enables you to create effects like smoke, fire, water, explosions, and magic. We’ll learn how to add sparks and explosions to a 3D bomb model, and how to use scripting to play and stop animations on a 3D character. You’ll need to know this stuff to complete The Break-Up—a catch game that has you grabbing falling beer steins and dodging explosives tossed out the window by your jilted girlfriend.

Chapter 10, Game#3: The Break-Up Part 2, completes The Break-Up game from the previous chapter. You’ll learn how to reuse scripts on multiple different Game Objects, and how to build Prefabs, which enable you to modify a whole army of objects with a single click. You’ll also learn to add sound effects to your games for a much more engaging experience.

Chapter 11, Game #4: Shoot the Moon, fulfills the promise of Chapter 2 by taking you through a re-skin exercise on The Break-Up. By swapping out a few models, changing the background, and adding a shooting mechanic, you’ll turn a game about catching beer steins on terra firma into an action-packed space shooter! In this chapter, you’ll learn how to set up a two-camera composite shot, how to use code to animate Game Objects, and how to re-jig your code to save time and effort.

Chapter 12, Action, takes you triumphantly back to Ticker Taker for the coup de grace: a bouncing camera rig built with Unity’s built-in animation system that flies through a model of a hospital interior. By using the two-camera composite from The Break-Up, you’ll create the illusion that the player is actually running through the hospital bouncing a heart on a tin tray. The chapter ends with a refresher on bundling your project and deploying it to the Web so that your millions of adoring fans can finally experience your masterpiece.

What you need for this book

You’ll need to be in possession of a sturdy hat, a desk chair equipped with a seatbelt, and an array of delicious snack foods that won’t get these pages all cheesy (if you’re reading the e-book version, you’re all set). Early chapters walk you through downloading and installing Unity 3D (http://unity3d.com/unity/download/). A list of resources and links to additional software can be found in the appendix.

Who this book is for

If you’ve ever wanted to develop games, but have never felt “smart” enough to deal with complex programming, this book is for you. It’s also a great kickstart for developers coming from other tools like Flash, Unreal Engine, and Game Maker Pro.

What’s Next?

Got any more questions? Drop me a line in the comments section and i’ll answer them here.

35 thoughts on “Unity 3D Game Development by Example is Now Available for Pre-Order

  1. Bwakathaboom

    Are your code samples in Javascript, C# or Boo? Obviously I’d prefer to use Javascript, it being so close to my beloved AS2.

  2. Will Goldstone

    I never realised screaming volcano death was such a hazard to new developers! ;) any chance of a preview to make sure my 2nd edition doesn’t overlap your book?

    1. Ryan Henson Creighton

      Hey, Will! A second edition – how exciting! What does that involve … extra chapters? Will you be writing about new version 3 features? i was a little nervous that my stuff would be outdated the moment version 3 came out, but many of the new features are for more advanced projects. Everything i wrote about holds up. The only really obvious UI change is the Search field in the Scene window. No biggie.

      You’re Packt’s golden boy … i’m sure if you request a crate of my books to perch on as a throne while you write your second edition, they’ll oblige. :)

      1. Will Goldstone

        Hey man, yeah just realised my own mistake – to just ask packt, I had the same deal when my book came out, should have thought to speak to the guys there first!

        Second edition for me is just more content, a few updates as far as scripts go and just in general more stuff – you’ll realise this once you get some distance is there are lots of things that whilst in the midst of writing a book just don’t spring to mind, even with the awesome amount of eyes on it editorial wise that Packt give you, there’s always ‘one more thing’ as Apple put it.

        Also I’ve taken your criticism on board about the route into the book – I totally get where you’re coming from (hence my work on unity3dstudent.com) – simpler early on is ideal, so I’m betting your book is gonna be awesome – so i’m gonna try and build in a chapter as a precursor to kicking things off on the island, just something to get people into using the interface and method of Unity before they start the whole terrains & models thing.

        My main other question I guess then is whether I should recommend your book as a next step in my last chapter – that’s why I wanted to check for overlap in content – anyway, I’ll hopefully get a preview from Packt and see for myself too. All the best!


        1. Ryan Henson Creighton

          Thanks, Will! i gave you a well-earned shout-out in one of the early chapters of my book.

          i think simpler is better, but sexier sells. Your book has a lot more sex, and i’m a little nervous that people will decry my book for not having enough 3D in it. There are lots of ways to work in a 3D environment. My book has four small projects: a 3D game, two 2.5D games, and a 2D game. But some folks may not consider the 3D game a “true” 3D game, because of a narrow viewpoint – “if i can’t walk around a 3D world, it ain’t a 3D game.” You know?

          All in all, i think the two books complement each other very well. If i were to write another book or an update, i might like to cover some stuff on database connectivity, multiplayer servers, some very light AI, and maybe even augmenting the Unity 3D interface to build your own tools and panels. Slightly more advanced, but nothing overboard. You think there’s a market for a book that teaches C# instead of JavaScript?

  3. Pingback: Unity 3D Game Development By Example by Mr @UntoldEnt himself —Infinite Unity3D Infinite Unity3D

  4. Pingback: The Infinite Unity3D Book List —Infinite Unity3D Infinite Unity3D

  5. Chris Harshman

    Can’t wait to buy it.

    The only problem I have with Unity (Not Pro) is No Full Screen Post Processing, Render to Texture and Profiler, the Video, the rest isn’t that useful, but given that things like XNA can do those really easy, for free no less, which exception of the profiler.

    1. Ryan Henson Creighton

      The key advantage of Unity over XNA is that Unity has an IDE. XNA is just a code framework. You can’t “physically” move your models around or set your scene with XNA development. Eggheads often fail to realize that many of us can’t concretely visualize things that exist solely in an abstract space. Unity lets the rest of us develop games. It is an equalizer.

  6. Scott Petrovic

    Hey. Congrats on the book coming out. I was wondering if you had any table of contents yet on the topics covered. I see the bullet points on the Packt website, but was wondering if anything more was available. Thanks!

      1. Ryan Henson Creighton

        Alright! i’ve added a chapter listing and a few words from the book’s preface. Hope that helps. Thanks for the suggestion!

        – Ryan

        1. Scott Petrovic

          Thanks for updating it. Looking it over, it looks quite a bit different in terms of structure and topics covered than Will’s book. I wasn’t going to get the book originally, but after seeing this, I probably will.

    1. Ryan Henson Creighton

      Thanks for the endorsement, Chico! And thanks especially for your work on the book! It won’t be long now …

    1. Ryan Henson Creighton

      No, it doesn’t – but i’ll stress that it’s a beginner-level book, and most of the features added to Unity v3 are advanced features. No sense teaching how to rig up a softbody gameobject with multiple colliders when the reader doesn’t know what a collider is, or hasn’t had any initial experience with rigidbodies. You know?

  7. Stu

    Ryan. Your book is awesome! I have just about completed it and am on Chap 12 now. While it is good that your book includes the asset packages for various chapters, it would be sweet if you had the game scenes for the chapters as well. I didn’t make backup copies of my completed book chapters and went on my merry way to modify things to see what happens. However, in getting to the last chapter I needed to start with a project from a previous chapter and that project was totally wrong in starting the new chapter. Could you include the game scenes and objects for chapters so we could all start at the same point? Thanks!

    1. Ryan Henson Creighton

      Thanks, Stu! Uploading a list of completed projects as they stand in the book is very high on my to-do list. i’m also working on some supplementary material – additional tutorials, and different ways to expand on the games in the book. Sign up for my newsletter, and i’ll send you an email once these files and the additional tutorials are available.

  8. Wendy

    I just purchased the e-book edition; however, I can’t find a download link to the art assets on my Packt account — only a link to the code samples. Could you provide a direct link to the asset files to support the book projects? Thanks!

    1. Ryan Henson Creighton

      Just go to packtpub.com, click “Support and Errata” at the bottom of the site. Choose the book title, and you’ll be taken to a page where you can get the source files.

      1. Cole

        It would have really helped to have covered the requirement to download additional art assets in the book, and where to get them. It was never mentioned in the book and it took some searching online to find it mentioned here. Otherwise, it is a great book, well writen, and very helpful. Thanks :)

  9. Tom Alvarez

    I love your book so far. It is very explanatory and has great humor to it.

    I’m just stuck right now with the Robot Report Part 2 section. I’m getting an unknown identifier: ‘totalRobots’ alert and I can’t figure out why. Can you tell me where I can fine the sorce code for the programs in your book? It’s not part of the assets folder. Thank you so much.


    1. Ryan Henson Creighton

      Hi, Tom. The same place on the Packt website where you downloaded the assets folder should also include completed project files for various chapters. Does it not? Let me know, and i’ll sort it out.

  10. Matt

    Can you send me the completed script for “Robot Repair” I’m trying to get the gameScript to work and both myself and my class are struggling to get it to work. Its unclear in the text what order to place things in. HELP!!!

  11. Matt

    So….can you send me a copy of the finished robot repair script? It is not on the downloads page from packt pub. It would be greatly appreciated.

  12. Cheez

    Are the assets ever updated? I went out of my way to get the 2011 2nd edition of the book, but it seems a lot of the code has been outdated with the latest version of Unity I guess. I’m getting tons of compiler errors trying to build Robot Repair, and I have no idea where to start with fixing them since I am (obviously) a beginner to the language.

    1. Cheez

      Nevermind! Removing the #pragma strict solved my problems. I /thought/ it was weird getting errors for not initializing variables when declaring for loops like practically every other language does. Turns out I was just being subjected to some strict rules xD


Leave a Reply

Your email address will not be published. Required fields are marked *