Game Career Guide is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Get the latest Education e-news
 
  • Unite And Conquer: A 3D Game Making Tutorial In Unity

    [08.31.11]
    - Bradley Johnson
  •  Some will argue that 2010 was the year of the "indie," or independent game developer. Some may even argue that we've entered the decade of the indie. Part of the reason so many small studios have popped up recently is the availability of great tools to make games, alongside ease of deployment via the internet and mobile platforms. One of the major players in the game engine space is Unity.

    About Unity

    Unity is a game engine that lets you build for one platform and easily deploy to many others. You now have the web, PC, Mac, iOS, Android, and even major consoles at your fingertips thanks to Unity. Established companies, solo developers, students, and hobbyists use Unity to create not only 2D and 3D games, but also educational software, training programs, medical visualizations, and just recently, even military simulations. Making games is never an easy process, but using a game engine like Unity takes away a lot of the tedious and complicated tasks so developers can focus on creating great content.

    There's a free version of Unity that lets you deploy to the web, so it's a good idea to try it out before you spend money for the various licenses. There are both PC and Mac versions available for download at www.Unity3d.com.

    Everybody Loves Explosions!

    I've put together a tutorial for creating a very basic 3D game using Unity that we'll call 'Mr. Explody Barrel.' The tutorial uses some light scripting, but it should be simple enough for anyone to get a basic understanding of how things work. Here's a quick rundown of the Unity editor and some terms you'll need to know.

    A Unity project consists of at least one scene that can have any number of objects in it. A scene is like a level in a game, and it is where all of your game elements go-terrain, a camera, the player, exploding barrels, etc. For example, you can have a project with five different scenes, and each scene can be a different scenario with unique missions and art: Scene 1 could be a desert level, and when the player finishes the level, you could have it load up a jungle level for Scene 2. For this tutorial, we will just have one scene with a few basic objects in it.

    Looking at the picture of the Unity editor we see several different frames with various tabs. You can add, delete, resize, and drag and drop tabs to get the desired layout.


    Here are some items you need to know about. Note that an extensive manual for Unity can be found by navigating to Help->Unity Manual within the software itself.

    Scene tab

    This is where you'll be creating and repositioning objects in the scene. After placing an object in the scene you can click on it to highlight it. Once highlighted press W, E, or R on your keyboard to go into the Move, Rotate, or Scale modes. Zoom in and out using the mouse wheel. Rotate the view by holding option (on a Mac) + the left mouse button and dragging the mouse around. Pan the view by holding option + the mouse wheel and dragging the mouse. When an object is selected in the Scene view you can press the F key to center the view on it.

    Game tab

    This is where you'll play the game when running it from the editor.

    Hierarchy tab

    A list of all the objects in the current scene.

    Project tab

    A list of all the files in your project's asset folder. You can add outside files to your project by dragging them into the project tab. From within this tab, you can also create many different assets, such as scripts, materials, shaders, and prefabs.

    Inspector tab

    When clicking on an object, material, texture, mesh, or other element, this tab is filled with all the components and attributes associated with the selected item.

    Prefabs

    A prefab is a pre-made object (by you or someone else) that can be placed into a scene or instantiated at runtime. In this tutorial, we'll make a barrel prefab that has a mesh, collision, particle effects, and a sound associated with it.

    Components

    These are added to objects to give them various properties, such as scripts, particle effects, meshes, collision, physical properties, and the like.

    Mesh

    The visual component of the object

    Collider

    An invisible part of the object that will collide with other objects and terrain.

    Rigidbody

    This gives physical properties to the object so that it can move and bounce around the world like a real object.

    Material

    This holds info such as what type of shader and texture to use. Meshes and Particles need materials to be displayed properly.

    Cameras

    It's the eye of the game. Whatever the camera is pointing at during runtime is what will be shown when you're playing the game. You can have several cameras in a scene that you switch between (think of security cameras) or just one that follows the player around.

    Skybox

    The backdrop for a game (distant mountains, clouds, and that sort of thing).

Comments

comments powered by Disqus