In this article, I will explain how to use ‘Scene’ and create primitive objects, which are the basics of Unity.
Specifically, I will explain the following:
- The main windows
- Primitive objects available in Unity
- How to translate, rotate, and scale objects
- What is ‘Material’ in Unity?
- How to set up a material and color a 3D model
If you are new to Unity, refer to the following article to learn how to install Unity and create a project.
Once you create a project, the screen will be divided into some windows, which are Unity’s editor windows.
You will render 3D objects by using these editor windows.
Please remember the name of each window as they are referred to frequently from now.
- 0.1 1. The Hierarchy Window
- 0.2 2. The Scene View / The Game View / Asset Store
- 0.3 3. The Project View / The Console Window
- 0.4 4. The Inspector Window
- 1 How to Use the Inspector Window
- 2 Various Primitive Objects
- 3 Material
1. The Hierarchy Window
By default, it is placed at the top left of the screen.
Its the window where you can organize and display the files and folders used for the project.
You don’t need to focus on the details for this window right now.
2. The Scene View / The Game View / Asset Store
The Scene view displays ‘game’ scenes.
In this view, you can place components and operate them.
The Game view displays the view from the camera in the game.
‘Asset Store’ stocks 3D models required to create Scenes with Unity.
This article doesn’t cover how to use the Unity Asset Store, but please refer to the following article to learn more about the Unity Asset Store if you are interested in this topic.
3. The Project View / The Console Window
When making a Scene, you need to create a project.
The project includes the files to create a Scene.
In the Project view, you organize and manage the files of the project. You are going to create a Scene by opening and modifying various files in the Project view.
The Console window displays errors when the project is running.
The Console window is checked frequently when writing codes, but you don’t need to focus on this area right now. Just remember there is such a window.
4. The Inspector Window
You can manage various information about the selected file in the Inspector window.
Click a component in the Scene view to display its information in the Inspect view.
You can also change the settings of the component in the Inspector window.
How to Use the Inspector Window
The Inspector window is frequently used from the early stages, so let’s learn how to use it.
Create a Cube
I will show how to use the Inspector window while making a basic object.
Right-click on the Hierarchy windows and select ‘3D Object > Cube’.
A cube will be displayed in the Scene view.
Select ‘Cube’ in the Hierarchy window to display the information about it in the Inspector window.
There is an item called ‘Transform’ at the top of the Inspector Window.
You can adjust the position and scale of the model with this ‘Transform’ component.
I will explain three items in the ‘Transform’ component.
‘Position’ defines the position of the model. By default, it’s been set to (0, 0, 0).
There are grid lines in the Scene view. The origin of these grid lines is (0, 0, 0).
‘X’ and ‘Y’ correspond to the lateral and longitudinal direction and ‘Z’ corresponds to the depth.
‘Rotation’ defines the angle of the model. By default, it’s been set to (0, 0, 0).
The unit of those values is in ‘degrees’. For example, enter 90 for ‘X’ if you want to rotate the model around the X-axis by 90 degrees.
‘Scale’ defines the scale of the model. By default, it’s been set to (0, 0, 0).
If you want to keep the size ratio constant, you need to keep all the values the same. However, you can also scale the model in a specific direction by changing the individual values.
Various Primitive Objects
In addition to ‘Cube’, there are other primitives available in Unity.
Let’s see what kind of primitives are available so that you can use them when creating a Scene in the future.
As with ‘Cube’, right-click on the Hierarchy window and select ‘3D Object’ to create a primitive.
You can operate each primitive and set up the parameters in the same way as the ‘Cube’, so you don’t need to test each primitive here.
Just remember there are numerous primitives available.
It’s a sphere with a constant radius. You can create an ellipsoid by varying Scale values in ‘Transform’.
‘Cylinder’ is used as frequently as Cube and Sphere.
‘Capsule’ is not used so often as Cube, Sphere or Cylinder.
You can make a capsule-like object by combining Spheres and a Cylinder or you can easily make it by using this Capsule primitive.
‘Plane’ is used to create a 2D object such as floor or ground.
Unlike ‘Cube’, ‘Plane’ has no thickness, it will remain thin no matter how much you increase the Y value. Therefore, use ‘Cube’ if you want to make a flat object with a thickness.
All the models I have shown so far are ‘colorless’. The default color is displayed as grey.
When creating a Scene, it wouldn’t be practical to leave all the models grey because, in many cases, you want to color, have patterns, change textures, add irregularities, etc.
‘Material’ determines ‘how the model looks’ by defining the surface.
Now, let’s create a material.
In the Project view, right-click on the Assets folder and select ‘Create > Material’.
It creates a Material file. Rename it ‘Red’.
Once you select the Material file, the information about the material will be displayed in the Inspector window
In the Inspector, you find ‘Albedo’ set to white. It is where you can set the color of the surface.
Click the color box.
It brings up the color selection array.
For example, selecting a red color will change the material file from grey to red.
Apply the material file to the model in the Scene view by dragging and dropping it.
Now you have applied the ‘Albedo’ color to the model.
There are two parameters under the Albedo in the Inspector window: ‘Metallic’ and ‘Smoothness’.
The Metallic parameter determines how ‘metal-like’ the surface is.
It has a slider on the right, so you can increase the reflective aspect by moving the slider to the right (You can also enter the value directly).
‘Smoothness’ makes the reflection clearer.
It makes the object mirror things around it, so move the slider to the right if you want a realistic view by mirroring the objects around it.