Setting up an (almost) empty Unity project
The first thing you need to ensure is that you have a 3D model that you want to explore and you have a way to export it into one of the Unity supported formats. Please revisit Chapter 1, An Integrated Unity Workflow, to get more insight into this workflow.
When you launch Unity, by default it loads the last project you worked on. If this is a fresh install, this is usually the sample project called AngryBots that was installed, but while impressive, it is way too elaborate to use as a starting point. Start this chapter by creating a new, empty project by navigation to File | New Project…, which opens the Project Wizard as shown in the following screenshot. To open this wizard directly, hold the Alt key while launching Unity.
From this dialog, we can import Packages that have been installed with Unity. Packages are compressed files that contain a series of ready-to-use Assets. Check the Character Controller package for this example and skip the others. Name the project anything you want. When you press Create Project, you will see a loading screen, which prepares the project for you, including the installation of chosen packages. Next, you will see an empty Unity project, with the default GUI layout loaded, as shown in the following screenshot:
The GUI contains different tabbed windows and can be completely reorganized, to optimize screen space depending on your activity (for example, modeling, animation, lighting and so on). The main tabs present the information inside your project. These tabs are explained in the following points:
- Hierarchy Tab: This tab displays the content of the current Scene, which is usually a level in the game, but it can also be a loading screen or menu.
- Scene Tab: This tab is the 3D graphical view on the geometry inside the scene. This will be quite familiar if you come from CAD or 3D modeling software.
Note
One caveat! Like most 3D software, a coordinate system is displayed as three colored axes in Red, Green, and Blue, being X, Y, and Z respectively. But unlike most CAD systems, Unity uses the Y-axis as upward direction instead of Z!
- Inspector Tab: This tab displays the properties of any selected object, either from the Scene Tab or from one of the other tabs.
- Project Tab: This tab is (almost) a direct view on the
Assets
folder, as it displays all files a users needs to manage in a project. There are some additional hidden files and users are urged to only use the Unity interface to rename assets or move them around. - Game Tab: This tab is a preview of how the scene will look from the camera when you play the game, by pressing the triangular Play button on the upper toolbar.
When working in Unity, you manage one or more scenes (or levels) in which you place several GameObjects. Each GameObject has properties you can manage using the Inspector Tab. The actual properties vary between objects, but they all have the same basic structure, starting with a name and some metadata (information about the object), followed by the Transform
property, which is used by all GameObjects. The rest of the properties can vary, but they often contain some geometry (using a Mesh Filter), which is displayed using a Mesh Renderer. Additional components can be added, such as physical properties (so that objects can react to forces and collisions) and Scripts (by which objects can do almost anything). You can add components from the menu or by dragging scripts to GameObjects.
Create a simple Cube by navigating to GameObject | Create Other | Cube, which is placed, by default, in the origin of the scene. It is automatically selected so you can inspect its properties on the Inspector Tab, as shown in the next screenshot. You can adjust properties by typing the required values in the input fields or by dragging the property name left and right, having it act as some kind of slider.
While we said we would be loading one of our own models, it is advisable to also load a basic cube with scale values of 1 for each axis. In Unity, this creates a cube of size 1x1x1 meter.
Note
To be clear, Unity does not really enforce any particular unit size, but it is quite common to relate everything to meters. The cube will help us to assess the scale of an imported CAD or 3D model.