Learn Unity Unity Basics Part 1: Complete Guide for Beginners – From Unity installation to basic operationsBasics

 

What is Unity?

It can create games, 3DCG videos, and VR/AR content.

Unity is a game engine with all the features needed to create games.

Unity has all the functions necessary to create games, such as animation, camera control, physics, UI creation, and timeline, and can create 3D and 2D games such as action, shooting, RPG, and adventure games.

The cross-platform mechanism makes it possible to create games that run on home game consoles, PCs, smartphones, and other environments.

Unity can be used not only for games, but also for 3DCG video, VR (virtual reality), and AR (augmented reality) content.

Asset Store

In Unity, images and 3D models are called “assets.

When creating games or VR/MR/AR content, it is very difficult to create assets from scratch.

The Asset Store allows creators to easily use the assets they have created.

The Asset Store has countless free and paid assets that you can download, install, and use in your Unity project.

Unity Asset Store

Image47

How to Install Unity

How to create a Unity ID

Before installing Unity, you need to create a Unity ID.

Visit the Unity website at https://unity.com/にアクセスします.

Click on the human-shaped icon in the upper right corner.

Image19

Click Create a Unity ID.

Image8

Create an account.

If you already have a Google or Facebook account, you can link it to your Unity account.

If you wish to use a Google account, click Sign in with goole to link your account.

If you want to use your Facebook account, click “Sign in with facebook” to link your account.

If you want to create an account from scratch, please proceed as follows

Image54

Enter your email address in the “Email” field.
This will be used to log in to Unity.

You will also receive notifications from Unity at this address.

Enter your Password.

Please meet the following requirements.

  • At least 8 characters
  • At least 1 uppercase letter
  • At least 1 lowercase letter
  • At least one number or special character
  • All letters and numbers must be single-byte alphanumeric characters.

Enter your Username.

This will be displayed on Unity services and in the community.

Full Name

Enter your real name.

It will not be seen by others.

Check the three boxes.

I agree to the Unity Terms of Use and Privacy Policy

→Please read the Terms of Use and Privacy Policy and check the box if you agree to them.

I understand that by checking this box, I am agreeing to receive promotional materials from Unity

→□I understand that by checking this box, I am agreeing to receive promotional materials from Unity.

Click Create Unity ID.

You will receive an email from Unity to your registered email address.

Open the body of the email and click on “Link to confirm email” to complete registration.

Image42

Downloading and installing Unity (using Unity Hub)

Installing Unity Hub

We would like to install Unity using the official Unity Hub tool, which we recommend because it is useful for centrally managing multiple installations of different versions of Unity.

Install Unity Hub, which is required for Unity installation.

Access the following page

https://unity3d.com/jp/get-unity/download

Click Download Unity Hub to download the Unity Hub setup file.

Image68

Double-click the setup file to launch it. You will be asked to agree to the license and then to specify where to install the software.

Image5

Select Agree.

Image61

Select Install

When you launch the Unity Hub, you will see several sections on the left, including a list of projects in “Projects” and a Unity tutorial in “Learn How to Use”.

Image73

Unity License Settings

At the bottom of the screen you will see the message You have no valid license.

You need to set up your Unity license.

Image32

009_2

A license is a license to use Unity.

Depending on the type of license, the monthly fee, conditions of use, and services will vary.

In this article, we will show you how to set up a Personal license.

For more information on licenses, please click here.

Before setting up a license, sign in with the account you have created to connect your Unity account with the license.

Click on the account icon in the upper left corner, then Sign In.

Image31

If you already have a Unity ID, enter your account information and click Sign in (if you do not have a Unity ID, you will need to create one).

(If you do not have a Unity ID, you will need to create a new one.) Once you have signed in, click the gear icon in the upper left corner.

Click on “Licenses.

Image85

Click on “Add License”.

Image76

Select “Get a free personal license.

(Please read the license details carefully and choose the license that meets your requirements.)

Image65

Click “I agree and get a Personal license.

Image79

Once the license is reflected, you are done.

Image4

Installing Unity2019.4.29f1

Next, install Unity2019 itself.

Open the “Install” section, where you can manage the installation of the Unity editor itself.

Normally when installing Unity via Unity Hub, you can install it from the Install button.

Image35

However, if you try to install from Unity Hub, you can only choose Unity2019.3.5f1 as of this writing.

Image43

So to install the STYLY recommended Unity2019.4.29f1, go to the following archive page

https://unity3d.com/jp/get-unity/download/archive

Here you will find Unity2019.4.29 and click on the “Unity Hub” button.

Image13

This will open the Unity Hub and proceed with the dialog to download and install the desired version.

Check the modules you need to upload to STYLY.

  • Windows Build Support (If you are using Windows, Windows Build Support (If you are using Windows, it is installed by default. (If you are using Windows, it is installed by default, so the checkbox will not be displayed.)
  • Mac Build Support (For macOS users, (If you are using macOS, this is installed by default. (If you are using macOS, it is installed by default, so the checkbox will not be displayed.)
  • Android Build Support
  • WebGL Build Support
  • iOS Build Support
Image23

The Windows display screen.

Image38

The checkbox □ is not displayed on macOS because Mac Build Support is installed by default.

To upload prefabs and scenes from Unity to STYLY, 5 modules must be installed in advance.

Be sure to check them! (If you forget to check them here, you can add them later.)

(If you forget to check them here, you can add them later.) The other modules are not required for STYLY use, so you can uncheck them all, but there is no problem if you check them and install them.

Click the “INSTALL” button to start the installation.

The Unity version you selected will appear in the list in the Installation section, and a progress meter will show the status of the installation.

Image53

It will take some time as each module is downloaded and installed.

When completed, the progress meter display should disappear and you should see an icon for each installed module.

This completes the installation of Unity 2019.4.29f1.

How to use the Unity editor

Creating a new project

A project is the unit that manages the assets you create in Unity, scenes (see below), and other files related to the project.

Start the Unity Hub.

Image6

Click New project (New project in English) in the upper right corner to display the Create a new project with Unity 2019.4.29f1 window.

Image20

Select 3D for Templates.

(3D is selected by default, so you can leave it as is.)

Project Name is the project name.

Enter a name of your choice using single-byte alphanumeric characters.

Location is the location where the project will be saved.

Set it to the location of your choice.

Click CREATE.

Wait a moment…your Unity project will be launched.

Image29

A folder (project name) will be created in the location where you saved the project.

Under the folder, you will find the data that make up the Unity project.

Image78

Under the project name (New Unity Project), the folder structure is as follows.

For now, please be aware that the folder structure of Unity is like this.

Image70

Screen Layout (Recommended)

Here is the recommended screen layout.

Image62

Click Layout in the upper right corner of the screen and select 2 by 3.

Image16

It will change to the 2 by 3 layout.

About Windows

This section describes the five windows.

Image36

Scene View

In the scene view, you can place and move objects in the scene.

You can freely change the position and angle of the objects.

A scene is a space in the world where you create content.

Scenes in STYLY are different from scenes in Unity, but you can upload scenes created in Unity to STYLY and use them as is; we will show you how in section 9. Uploading Prefab Scenes to STYLY.

Image21

Let’s add a Cube to the scene.

Image51

Click on GameObject → 3D Object → Cube from the menu in the upper left corner of the screen.

Image24

The Cube now appears in the scene view.

Game View

The actual game screen is displayed; you cannot move objects in the game view.

The basic flow of Unity is to move objects in the scene view and check them in the game view.

Image11

The viewpoint seen in Game View is the one captured by the Main Camera placed in the scene.

Image18

Hierarchy Window

Objects in the scene are listed.

Image25

The current scene name is SampleScene.

This scene is automatically created by Unity when the project is created.

Below it is the Cube that was just created.

The Main Camera and Directional Light are already provided.

In the Hierarchy window (hereafter referred to as Hierarchy), you can organize objects by copying, pasting, and renaming them.

Image10

Objects in the hierarchy can be viewed in a scene.

Image64

Project Window

This is where all the assets needed for the game contained in the project are stored.

As a reminder, images and 3D models are called assets in Unity.

Image15

In the project window, you can import assets such as images from outside Unity and add assets to the hierarchy.

At the bottom of the window, you can see the folder hierarchy and file extensions.

Image66

The contents of the project window and the “New Unity Project” folder are the same.

Image55

When you create a Unity project, an Assets folder (“Assets”) and a Packages folder (“Packages”) are created.

When creating folders or adding assets, please create or add them under Assets.

Image34

Right-click on Assets and select Show in Explorer (Windows) / Reveal in Finder (macOS).

Image57

Show in Explorer in Windows

Image12

Reveal in Finder in macOS

The contents of the project window will be displayed in File Explorer (Windows) / Finder (macOS).

Image83

File Explorer (Windows) / Finder (macOS) Do not delete, rename, move, or otherwise change any of the files in the project.

If you do, the project may stop working.

Inspector Window

You can see detailed information about objects in the scene and project windows.

You can view and edit the object’s attributes such as size, position, collision detection, physics control, etc.

Image75

Click on the Cube in the Hierarchy.

You will then see the Cube’s size, position, and other information in the Inspector window (hereinafter referred to as the Inspector).

Image41

Let’s also click on Main Camera and Direcional Light in the Hierarchy.

Observe that the contents of the Inspector will change.

Image28

Scene View Perspective Manipulation

When creating a game, we work with scene views from various angles.

Let’s use the mouse and keyboard to change the viewpoint of the scene view.

You cannot change the viewpoint unless the mouse cursor is over the scene view, so be sure to operate the viewpoint with the mouse cursor over the scene view.

Image56

Rotation

Image71

Rotate the viewpoint around the center.

Specific operations

  • 3-button mouse
    • Alt + left click and drag (for macOS, option instead of Alt)
  • 2-button mouse, trackpad
    • Alt + left mouse click and drag (for macOS, option instead of Alt)
  • 1-button mouse, trackpad on macOS
    • Option + Command + left mouse click and hold, drag

Zoom in/out

Image14

The viewpoint zooms in and out.

For specific operations

  • 3-button mouse
    • Use the scroll wheel, or hold down Alt + right mouse button and drag (on macOS, option, not Alt)
  • 2-button mouse, trackpad
    • Alt + right click and drag (option instead of Alt for macOS)
  • 1-button mouse, trackpad on macOS
    • Swipe two fingers to zoom in/out, or option + Command + left click and drag

Parallel shift

Image26

The viewpoint moves in parallel.

For specific operations

  • 3-button mouse
    • Alt + hold down the center mouse button and drag (on macOS, option instead of Alt)
  • 2-button mouse, trackpad
    • Alt + Control + left-click and drag (option instead of Alt for macOS)
  • 1-button mouse, trackpad on macOS
    • Option + Command + left-click and drag

Focus

Image49

While working in scene view, an object may move far away or disappear from the screen.

In such cases, a convenient method is focus.

Image46

Double-click on the Cube in the Hierarchy.

Image67

The Cube now appears in the middle of the scene view.

Keep this in mind as you can use it if an object disappears while you are working.

Conclusion

There are many other ways to change the viewpoint, but first let’s learn the four basic viewpoint operations.

  • Rotation
    • Alt key (Windows) / Option key (macOS) + left mouse click and drag
  • Zoom in/out
    • Rotate the mouse wheel
  • Parallel movement
    • Push in the mouse wheel and drag as you go
  • Focus
    • Double click on object

Game Object Manipulation

Movement Mode

When you select a Cube, you will see red, blue and yellow arrows.

These are the gizmos (gizmos) that manipulate the objects.

Image7

There are three modes of gizmo.

The toolbar above the scene view can be toggled to use it.

Image45

Select Move Tool from the upper left menu (or press the W key) to enter move mode.

A gizmo will appear with arrows extending in three directions along the X, Y, and Z axes.

Image60
Image81

Click and hold the arrow with the left mouse button to move it in the direction of the axis you are clicking on.

Image33

Rotate Mode

Select Rotate Tool from the upper left menu (or press the E key) to enter the rotation mode.

A gizmo with a ring combination of X, Y, and Z axes will appear.

Image3
Image87

Click and hold the left mouse button to rotate the ring in the direction of the axis you are clicking on.

Image74

Scaling Mode

Select Scale Tool from the upper left menu (or press R key) to enter the scaling mode.

A gizmo with squares extending in the three directions of the X, Y, and Z axes will appear.

Image22
Image27

Click and hold the left mouse button and move the square to scale in the direction of the axis you are clicking on.

Image48

It is more convenient to use shortcut keys than to change the mode from the menu, so learn the shortcut keys.

  • Move
    • W key
  • Rotate
    • E key
  • E key Zoom in/out
    • R key

Reset Transforms

Reset transformations when you manipulate a game object and want to undo it in the middle of the operation.

Image63

With the Cube selected, look at the Transform component in the Inspector.

Each of the elements that make up the Cube is called a component (a detailed description of components will appear in the next section).

The Transform component is the most basic component that must be present in all game objects, determining the position, rotation angle, and size of the object in the scene.

Image2

The Position parameter determines the position of the object, the Rotation parameter determines the angle of rotation, and the Scele parameter determines the size of the object.

Each of these parameters has three axes: X-axis, Y-axis, and Z-axis.

Since all the parameters are messed up, let’s reset the values.

Image84

Open the Transform context menu and click Reset.

Image1

Position, Rotation, and Scale are now reset instantly.

Now the Cube’s state has returned to its initial values.

Image69

The initial values for Transform are as follows

Transform

X

Y

Z

Position

0

0

0

Rotation

0 0

0

0

Scale

1

1

1

Copying and Renaming Objects

Let’s make a simple box by changing the Tranform of Cube.

Image80

Set Cube’s Scale to ( X , Y , Z )=( 1 , 0.05 , 1)

It now looks like a flat board.

Image82

Right click on the Cube in the hierarchy and select Duplicate to copy the Cube.

Image30

Copy three more Cubes.

Now, on the Cube, perform the following commands in the order of Copy → Paste.

OS

Copy

Paste

Windows

Ctrl + C

Ctrl + V

macOS

Command + C

Command + V

Then the Cube is increased to Cube(4).

Image59

Next, let’s change the Cube’s name and Transform value based on the following table.

First, to change the object name, right click on the Cube in the hierarchy and select Rename.

Image86

Alternatively, change the object name form the top of the Cube inspector.

Image39

You can also rename it by entering the following shortcut keys

Windows

Select an object in the Hierarchy and press F2

macOS

Select an object in the hierarchy and press RETURN

Now, let’s change the object name and Transform based on the table below.

Object Name

Transform Name

X

Y

Z

Cube → floor

Position

0

0

0

Rotation

0 0

0

0

Scale

1

0.05

1

Cube(1) → right wall

Position

0

0.5

0.5

Rotation

0.5 0.5 Rotation

0

0

Scale

1

0.05

1

Cube(2) → left wall

Position

0

0.5

-0.5

Rotation

0.5 -0.5 Rotation

0

0

Scale

1

0.05

1

Cube(3) → back wall

Position

-0.5

0.5

0.5

Rotation

0

0

0 0

Scale

1

0.05

1

Cube(4) → front wall

Position

0.5

0.5

0.5

Rotation

0

0

Scale

Scale

1

0.05

1

Once the box is created, it is ready to be used.

Image58

Deleting Objects

To delete an object if you have copied too much by mistake, right-click on the Cube in the hierarchy and select Delete.

Image9

The following shortcut keys can also be used to delete an object

Windows

Select an object in the hierarchy and press Delete

macOS

Select an object in the hierarchy and press Command + delete

Undo operation

Select a floor in the hierarchy, put it in scaling mode, and change the scale to the one you want.

Image17

If you want to undo this operation (return to the previous state), use the following commands

Windows

Ctrl key + Z

macOS

Command key + Z

Now you are back to the previous state.

Image72

To redo the operation you just undid, use the following commands

Windows

Ctrl key + Y

macOS

command + Shift + Z

Playback Mode

Game Objects and Components

There are two playback modes: “Create Game” working mode and “Run Game in Game View” playback mode.

If you press the Play button in a scene where the Cube is just placed, nothing will happen.

In this case, let’s add a gravity element to the Cube and watch the Cube fall when we put it in Play mode.

Image52

Game objects are objects such as Main Camera, Directional Light, and Cube.

So what is a component?

Image77

A component is a way of moving or functioning of a game object.

Let’s add a component to the Cube.

Rigidbody Component

Rigidbody allows you to add physics to game objects.

Physical properties include collision reaction and gravity.

Let’s quickly add a Rigidbody component to the Cube.

Image37

Click on the Cube in the Hierarchy.

The Cube’s components will appear in the inspector.

Image44

Click the Add Componet button in the inspector to display the search form.

Type “Rigidbody” in the search form.

Rigidbody will appear in the search results.

Image50

Rigidbody is now added to the Cube inspector.

Image40

Playback Mode

Click the Play button to check the operation.

Did the Cube fall?

Click the Play button again to return to edit mode.

Image37