ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

Game Development with Unity3D: Basic Concepts

Updated on October 3, 2016
beagrie profile image

John is a fervent writer, gamer, and guitar lover. He is a former automatic-transmission repairer, welder, and hobbyist game developer.

Following in the well-tread footsteps of cinema, video games have become a legitimate entertainment medium. They’re bigger than ever, so it’s no surprise that more and more people want to get into game development. Fortunately, with this growing desire to make video games comes an increasing ease with which one can do so in the form of free-to-use game engines and “game maker” applications. Despite this, it’s still essential to understand the basic nuts and bolts in order to produce a good product, and in this hub we’re going to do just that.

Though we’ll be focusing on Unity3D, many of the concepts we will be covering are translatable into other game engines.

Let’s get started.

Projects

A project represents your game within Unity. Any assets used, any settings saved, all of this is stored as part of your project. The information saved may cover a range of things such as graphical settings, input settings, and much more. Unity assets are not pulled from external sources once imported, meaning every asset you use is stored in your project folder and it can get pretty big if you’re working on a particular asset-rich game.

Scenes

The scene view in Unity allows you to edit your game visually.
The scene view in Unity allows you to edit your game visually. | Source

Much like the movies, a Scene in Unity is where a portion of your game plays out. To take a simple game design standard as an example, if you were to create a good old fashioned first person shooter such as Doom, or Unreal Tournament, each “map” would be its own scene.

The main reason for Scenes is resource and memory management. There’s no sense in loading your game’s entire asset library when the portion of the game currently being played only requires 8% of it.

Scenes are not limited to different levels, however. Things like the game’s main menu will often be placed in its own scene.

Transforms

The transform properties allow you to modify the position and rotation of a GameObject.
The transform properties allow you to modify the position and rotation of a GameObject. | Source

Simply put, a Transform is the state of a GameObject, specifically it’s location and orientation in the game world. The most basic use of a Transform would be to move an object such as a player character. If the player presses forward, move the player character forward. Where the Transform really comes into play, however, is knowing which way forward is. Simply moving the player character along an axis (typically the Z axis is used as front-to-back in relation to the gamer) is great until the player turns to face another direction, then suddenly the axis that was forwards might become sideways, or something in between. That’s why Unity’s Transform class has a number of useful features such as the ability to get specific directional data, meaning you can find out the direction a Transform is facing, which way is up for that transform, and so on.

A simple way of moving an object forwards would be to add that objects forward direction to its position, thus moving it in that direction. Again, that is a very simplistic way of achieving movement, but more complicated methods are for another time.

GameObjects

A GameObject in Unity is, as you might expect, any object that can be moved, scripted, activated, and so on. A GameObject can be anything, whether it be a static 3D model of a house that simply sits in the background and does nothing, an animated non-player character, or even an object with no visual properties that is simply there to trigger events.

The concept of a GameObject in Unity is not a complicated one, however it is the relationship between those GameObjects that makes the game work. For example, if you have a one GameObject that is your player character, you could make it the parent of another GameObject that is your camera. Now wherever your player character goes, your camera remains in the same position relative to it, no code necessary. Another way of achieving the same result would be to place a script on the camera GameObject that moves it in relation a given object, and then drop the player character GameObject in there as a reference.

GameObjects do eat up resources, however. And while modern computers can handle a lot, you might find situations where it’s just not practical to give every “entity” its own GameObject. The most obvious example of that being in the making of a Minecraft-like game, where it is simply not feasible to make each “block” its own GameObject.

Prefabs

Technically a Prefab is just another GameObject. What makes it distinct enough to warrant its own section in this hub is the fact that it will often be a collection of GameObjects under the umbrella of a single one. Perhaps you’ve spent a long time crafting a non player character to get it to behave just right, and you want to duplicate it so you don’t have to recreate it all over again. Making said NPC into a Prefab not only allows you to copy that Prefab with ease, it also allows you to easily create new instances of the Prefab during game time, such as for spawning new NPCs.

Cameras

The standard camera in Unity has a range of values that can be modified.
The standard camera in Unity has a range of values that can be modified. | Source

In the game world, your camera is your window, without it the player cannot see what’s going on in there and that makes for a dull game. The camera is a GameObject just like anything, else and as such can be manipulated and scripted in the same way. Where the camera differs, however, is in the range of options provided by the camera script for things like field of view, perspective, render distance, and more.

The direction of your camera object is, of course, the direction in which the gamer will be looking, so it’s on you as a game developer to ensure that the camera is always facing where the action is. Sticking with our theme of providing a very basic example, one could use a simple “LookAt()” command to have the camera constantly pointing at the player character. “LookAt” may appear to be a visual thing, but it’s nothing to do with the camera specifically, but rather the Transform of the camera object. Simply put, it orients the given Transform (the camera in this case) so that it's forward direction is pointing at the location you pass to it.

Lights

Though this shouldn’t need much explaining conceptually, it’s easy for those new to the game development world to overlook this essential component. Simpler (and older) game engines would actually require a lot of effort and resources to make things dark, but Unity has a good lighting system built in. Because of this, neglecting to add a light to your scene will leave your players finding it very hard to see what’s happening.

There are different kinds of lights for different applications. The main consideration when choosing a type of light is system resources. Lighting is one of the most resource-intensive things in a game, and placing a lot of light sources that update in real time all over your scene will bog your player’s gaming device down. Similarly, using pre-baked lights that don't interact with the game world in real time will give the world a sterile, fake feel. As with many things, the best approach tends to involve a mix of multiple methods.

The Editor

Before we leave it would be wrong to not at least touch on the editor itself, so here are some key aspects of the Unity3D editor interface.

  • Scene View - Think of this as an editor window. This shows you your game world from the all seeing eye of the game developer, able to move around at will, dragging and dropping things as you please.

  • Game View - As you might expect, the game view shows you your game as it will appear to the player.

  • Project View - The project window allow you to easily navigate through your game assets, such as models, scripts, materials, and more.

  • Hierarchy View - The hierarchy is similar to the the project window except that it only shows assets that are in the current scene. As the name suggests, it also shows the hierarchy of those assets.

  • Inspector View - The inspector shows you the attached components of a selected GameObject. All GameObjects have a Transform, so that will be in there, but any other components such as Camera or Lighting will also be accessible through the inspector.

This hub could go on but we have to draw the line somewhere. Though this hub is by no means a "make your own game" tutorial, it does contain some of the foundations on which you will building your knowledge as you learn to use Unity.

© 2016 John Bullock

working

This website uses cookies

As a user in the EEA, your approval is needed on a few things. To provide a better website experience, hubpages.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://corp.maven.io/privacy-policy

Show Details
Necessary
HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
LoginThis is necessary to sign in to the HubPages Service.
Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
AkismetThis is used to detect comment spam. (Privacy Policy)
HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
Features
Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
MavenThis supports the Maven widget and search functionality. (Privacy Policy)
Marketing
Google AdSenseThis is an ad network. (Privacy Policy)
Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
Index ExchangeThis is an ad network. (Privacy Policy)
SovrnThis is an ad network. (Privacy Policy)
Facebook AdsThis is an ad network. (Privacy Policy)
Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
AppNexusThis is an ad network. (Privacy Policy)
OpenxThis is an ad network. (Privacy Policy)
Rubicon ProjectThis is an ad network. (Privacy Policy)
TripleLiftThis is an ad network. (Privacy Policy)
Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
Statistics
Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)
ClickscoThis is a data management platform studying reader behavior (Privacy Policy)